FireWyrmNativeMessageHost quits unexpectedly

21 views
Skip to first unread message

LIANG ZHOU

unread,
Oct 22, 2018, 1:59:28 AM10/22/18
to firebreath-dev
Hello,
  I'm using the latest version of Firebreath 2.0. I found that when I use printf("") funciton in my plugin code, like in get_version(), the host process will quit unexpectedly, with the error message "An Unexpected Error has ocurred:  Host disconnected" displayed in web browser console.

std::string KIYPluginAPI::get_version()

{

    printf("get_version");

    

    return FBSTRING_PLUGIN_VERSION;

}


 
While debugging, there is no exception thrown by host process.
Any help is appreciated, thanks!

Leo

Richard Bateman

unread,
Oct 22, 2018, 11:46:04 AM10/22/18
to FireBreath Dev Group
Yep, that's absolutely going to happen; the reason is that it uses STDOUT to communicate with the browser.

I recommend you use logging instead.

Richard

--

---
You received this message because you are subscribed to the Google Groups "firebreath-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebreath-de...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Richard Bateman

unread,
Oct 22, 2018, 11:47:38 AM10/22/18
to FireBreath Dev Group
Thinking about it a bit more, you might be able to use STDERR instead and have it pass through to the output from the browser; I still recommend logging, though.

Richard

LIANG ZHOU

unread,
Oct 23, 2018, 8:55:16 AM10/23/18
to firebreath-dev
Thanks a lot, Richard.

在 2018年10月22日星期一 UTC+8下午11:47:38,taxilian写道:
Reply all
Reply to author
Forward
0 new messages