IRC Log Viewer » #firebreath » 2015-03-19

IRC Nick Time (GMT-7) Message
reichi 06:03 hi
taxilian 08:03 'morning
tvu 12:03 I am new to FireBreath plugin. Please answer me if I am on the right track.
I have a .NET library that can use by .NET windows application. Do I need Firebreath plugin to use the library in HTML javascript for .NET web application? If so, would you give the instruction steps what I have to do ?
taxilian 12:03 tvu FireBreath doesn't work with .NET
at least nobody I know of has gotten it working
FireBreath is C++
tvu: I don't know of a good way to do what you want to do
taxilian 13:03 kylehuff: you around yet by chance? I've just hit a point where your help would be awesome =]
kylehuff 13:03 taxilian: yeah, I'm here. was just about to poke you with a question
taxilian 13:03 go ahead with your question; just found one more thing I needed to do
and, btw, I can't tell you how nice it is to have someone working with me (even only a little bit) on this... I'm practically giddy, it's quite ridiculous. been working on this by myself for too long, I guess...
kylehuff 13:03 are the windows prep scripts operational?
taxilian 13:03 prep2013.cmd is
prep2013.cmd is
but only for FBTestPlugin
kylehuff 13:03 what about a blank plugin created with fbgen?
taxilian 13:03 not even slightly =]
however, that would be another great place you could help if you have time =]
however, that would be another great place you could help if you have time =]
I have completely changed the cmake structure
I have completely changed the cmake structure
I have completely changed the cmake structure
not as completely as I probably need to, but pretty thoroughly nonetheless
you could probably look at the CMakeLists.txt file for FBTestPlugin and figure out what needs to be changed to make it work with a blank plugin
you could probably look at the CMakeLists.txt file for FBTestPlugin and figure out what needs to be changed to make it work with a blank plugin
kylehuff 13:03 okay, that explains that. I will try to build with FBTestPlugin, which wasn't working, but I think that was my issue
taxilian 13:03 one major difference is that the name of the .sln file will be the name of your plugin, not FireBreath.sln
one major difference is that the name of the .sln file will be the name of your plugin, not FireBreath.sln
unit tests aren't working currently either, just FYI
unit tests aren't working currently either, just FYI
kylehuff 13:03 ah, okay. I'll add it to the todo list.
taxilian 13:03 brb, then I need to create an extension to test this with
kylehuff 13:03 while you do that, I'll try not to get sucked into playing with these ESP8266 wlan SoC boards I just got in the post...
taxilian 13:03 LOL
sounds fun =]
okay, so what do I need to do to make this new extension
is there a place I request this extension id?
is there a place I request this extension id?
kylehuff 13:03 the extension ID is in chrome.runtime.id, IIRC
the extension ID is in chrome.runtime.id, IIRC
taxilian 13:03 so say I start with the extension you put in your example: https://github.com/kylehuff/api-tests/blob/master/native-host-extension/manifest.json
but I want to make one for FireBreath
what do I change?
kylehuff 13:03 oh, okay, so the extension ID isn't really needed for anything except your native host manifest
oh, okay, so the extension ID isn't really needed for anything except your native host manifest
(just to allow it to talk to the native host binary)
taxilian 13:03 okay; that's kinda important, though =]
kylehuff 13:03 as far as changes to the extension, you should just need to line 49 of main.js to the native host id used in your native host manifest
taxilian 13:03 okay, but what if I wanted to make a new extension that would be distinct from this one?
don't any of the other things in the extension manifest matter?
kylehuff 13:03 oh, you just need a manifest.json file, and a background script. the only changes to the manifest is to delete the "key" key (so it will generate a new one for you), and remove the "app" key, since you want an extension, not an app
taxilian 13:03 sorry, I know next to nothing about chrome extensions
kylehuff 13:03 I have a barebones extension somehwere. just a sec
taxilian 13:03 where does the Extension ID (manifest.json line 2) come from?
kylehuff 13:03 it is generated from the extension key, which is generated by chrome.
taxilian 13:03 ok; so how do I make it generate a new key so that I can find that?
ok; so how do I make it generate a new key so that I can find that?
because the native messaging manifest seems to need to know that
kylehuff 13:03 https://github.com/kylehuff/chrome_extension_example/tree/master/extensions/examples/base_ext
well, it will need the extension ID, not the key. you get the key by clicking "Pack Extension" in chrome://extensions
leave the "private key" field blank, and it will generate the private key and save it in the same directory as the output .crx file
(the crx file can then be deleted... only the key is relevant...)
once you have the key, you can place it into your manifest to make sure that you always have the same extension id
once you have the key, you can place it into your manifest to make sure that you always have the same extension id
taxilian 13:03 okay
okay, so I need to pack my extension
kylehuff 13:03 also, that example is rather old.. I need to update it. inline JS is not longer allowed, so the background.html page is wrong.
taxilian 13:03 so for now I'm going to start with the example from api-tests
unless you think that's a bad idea
kylehuff 13:03 no, that should be fine. the only thing different is api-tests is an app, not an extension (for this subject, it probably makes no difference)
no, that should be fine. the only thing different is api-tests is an app, not an extension (for this subject, it probably makes no difference)
taxilian 13:03 I removed the app lines, which should fix that, right?
so how do I launch the extension and play with it?
I did load unpacked extension and it says it's loaded
kylehuff 13:03 well, as an extension, there is no launch. extensions are supposed to inject JS into a web page
that is why I originally created it as an app, so it could provide a simple demo page for interacting with the native client
taxilian 13:03 ahh
that might be easier
I'll put it back =]
kylehuff 13:03 heh
once we have the interface nailed down, we can migrate to an extension and provide a page accessible API
taxilian 13:03 right
right
right now I just want to see if it's communicating with the executable
kylehuff 13:03 it should do that as it is now, with only minor changes. (in main.js, the data being sent is wrapped as {"text": <message>} - line 33)
taxilian 13:03 hmm. "Failed to connect: Invalid native messaging host name specified."
kylehuff 13:03 have you regstered the native host via the registry?
have you regstered the native host via the registry?
taxilian 13:03 I think so
I think so
https://www.dropbox.com/s/fqow644j3wcgsbk/Screenshot%202015-03-19%2013.47.49.png?dl=0
kylehuff 13:03 I've had bad luck with case it comes to native host names
taxilian 13:03 fail enough; I'll try all lowercase
kylehuff 13:03 also, for mine (which is working), I had to double escape the path, i.e. C:\\path\\to\\host.exe
s/had to/have it/ -- I don't know if it is needed or not. I can't recall.
taxilian 13:03 worth trying
hmm. progress? Failed to connect: Specified native messaging host not found.
kylehuff 13:03 I have a 1+MB text file filled with notes on this crap, but I can't find it at the moment
I have a 1+MB text file filled with notes on this crap, but I can't find it at the moment
taxilian 13:03 hehe
I'll enable logging, see if that's useful
kylehuff 13:03 generally not... lol
taxilian 13:03 ERROR 4568 3192 13:55:10-607 c:\b\build\slave\win\build\src\chrome\browser\extensions\api\messaging\native_process_launcher.cc 140 Failed to load manifest for native messaging host org.firebreath.firewyrmhole: Invalid value for name.
kylehuff 13:03 hmmm
taxilian 13:03 tried adding to HKLM, no difference
kylehuff 14:03 what do you have in your org.firebreath.firewyrm.json file?
taxilian 14:03 {
{
"name": "org.firebreath.firewyrmhole",
"name": "org.firebreath.firewyrmhole",
"description": "FireBreath FireWyrm Native Messaging Wyrmhole",
"path": "C:\\code\\FireBreath2\\build\\firebreath\\NativeMessageHost\\Debug\\FireWyrmNativeMessageHost.exe",
"type": "stdio",
"allowed_origins": [
"allowed_origins": [
"allowed_origins": [
"chrome-extension://akniliibfnihibjacjocjcgmjdhopfjp/*"
"chrome-extension://akniliibfnihibjacjocjcgmjdhopfjp/*"
]
]
}
}
ahh
it was the * in the url
thought I'd removed that
kylehuff 14:03 ah, good catch
ah, good catch
taxilian 14:03 excellent, it connected
launched, I mean
now to see what it does
kylehuff 14:03 word.
kylehuff 14:03 okay, FBTestPlugin prepped with 2013 fine
kylehuff 14:03 I'm in great suspense to know if it is at least pretending to work. lol
taxilian 15:03 hehe. it is indeed
kylehuff: sorry I got distracted talking to coworkers; I have messages passing both directions
kylehuff 15:03 great
taxilian 15:03 hmm. except currently only the first one works
kylehuff 15:03 is the port closing?
is the port closing?
taxilian 15:03 doesn't look like it
doesn't look like it
the message still gets to the plugin
just not getting a response
probably something in my code
kylehuff 15:03 ah, well if the port isn't closing, your loop is working to provide a persistent connection
ah, well if the port isn't closing, your loop is working to provide a persistent connection
taxilian 15:03 yeah
so I can keep receiving, but when I send it back it isn't working
void writeMessage(std::string output) {
uint32_t a = output.size();
fwrite(&a, sizeof(a), 1, stdout);
fwrite(output.data(), sizeof(char), output.size(), stdout);
fflush(stdout);
that's how I'm writing; did that to avoid using cout
so it's all consistent
kylehuff 15:03 is there any debug from chrome? if it doesn't like your size information, it usually says something like "app tried sending <some huge number> of bytes"
is there any debug from chrome? if it doesn't like your size information, it usually says something like "app tried sending <some huge number> of bytes"
taxilian 15:03 let me start over and find out
no log output at all
kylehuff 15:03 weird. I know I had issues with passing messages on windows. I ended up needing to strip newlines out of the payload.
taxilian 15:03 actaully I was just remembering that and looking to try it
kylehuff 15:03 if I could find my damn notes, I could tell you *why* that was needed
it may have just been due to the type of data I was sending, I don't remember
so, if the FBTestPlugin won't register (no entry point DLLRegister), is that an indication that VS2013 community edition is a no-go?
so, if the FBTestPlugin won't register (no entry point DLLRegister), is that an indication that VS2013 community edition is a no-go?
taxilian 15:03 there are missing DLL dependencies
I don't know why
but you aren't the first to see it
use the 90 day trial of the pro version =]
we'll try to figure the other out later
kylehuff 15:03 okay. I'll do a depwalk and see if I can't get it to load for now. it would take ages to install 2013 pro
okay. I'll do a depwalk and see if I can't get it to load for now. it would take ages to install 2013 pro
taxilian 15:03 okay
yep, that was it
newline
kylehuff: working now!
kylehuff: working now!
hehe
now what I don't know is how to tell when Chrome isn't connected anymore
kylehuff 15:03 connected to the native messaging port?
taxilian 15:03 yeah
in other words, I don't know how to close the host when Chrome is done with it
btw: • Windows-only: Make sure that the program's I/O mode is set to O_BINARY. By default, the I/O mode is O_TEXT, which corrupts the message format as line breaks (\n = 0A) are replaced with Windows-style line endings (\r\n = 0D 0A). The I/O mode can be set using http://msdn.microsoft.com/en-us/library/tw4k6df8.aspx.
btw: • Windows-only: Make sure that the program's I/O mode is set to O_BINARY. By default, the I/O mode is O_TEXT, which corrupts the message format as line breaks (\n = 0A) are replaced with Windows-style line endings (\r\n = 0D 0A). The I/O mode can be set using http://msdn.microsoft.com/en-us/library/tw4k6df8.aspx.
got it
it now stops correctly
excellent
this is going very well
kylehuff 15:03 I thought O_BINARY mode was already set?
I thought O_BINARY mode was already set?
oh, wait, that was the example host
nevermind
taxilian 15:03 I may have missed that line
anyway, I did both; set O_BINARY and also stripped the \n off
anyway, I did both; set O_BINARY and also stripped the \n off
so we should be good =]
I'd rather not send the extra data anyway
I'd rather not send the extra data anyway
no point
kylehuff 15:03 agree
agree
depend walker is not very helpful...
taxilian 16:03 sounds frustrating :-/
I'm working on getting the plugin to load using hardcoded path
just about there, I think
of course, then a whole new set of frustrations start =]
kylehuff 16:03 the frustrating part is, I just want to test this so I can mark it as done!
taxilian 16:03 hehe
just loaded the plugin!
now to instantiate it...
taxilian 16:03 kinda fun to finally execute code I've been working on for a month
kylehuff 16:03 I bet.