IRC Log Viewer » #firebreath » 2013-06-25

IRC Nick Time (GMT-7) Message
wavey 03:06 Wayne__: I would recommend going the javascript way
FB::DOM::WindowPtr window = m_host->getDOMWindow();
then you do whatever you would have done in javascript
FB::JSObjectPtr jsNav = window->getProperty<FB::JSObjectPtr>("navigator");
std::string version = jsNav->GetProperty("appVersion").convert_cast<std::string>();
(like navigator.appVersion)
Wayne__ 04:06 I will give a try. Thanks wavey
thoys 06:06 Just came here to thank the dev team here, donated 50 bugs, had some good uses of the plugin sofar at my job
kylehuff 07:06 thoys: thank you for saying so, and your contribution! taxilian is the core developer, and I know he appreciates you dropping by more than he can say while he is away. =c )
thoys 07:06 hehe cool
I made a label printer plugin sofar, so making little product tags through a webshop backoffice, now im working on a plugin to print bigger labels, that are attached to watch-repairs
It took me a while to get this all going, but once its going, its unstoppable :)
kylehuff 07:06 just curious, what is the interface to the printer(s)?
thoys 07:06 the plugin that I've already made was for a POS printer, it was for citizen printers, had to learn that printer language, but the next plugin im working on is for regular labelsticker printers, I use GDI+ to print on the document and some WINAPI functions
the plugin I made can also open a POS cashdrawer
pretty cool
kylehuff 07:06 ah, okay. cool.
thoys 07:06 kylehuff: do you use firebreath urself?
kylehuff 07:06 thoys: yes
thoys 07:06 I need to get some bytes from an url, whats the easiest way to go?
with bytes from an url , i mean downloading a file to the memory
kylehuff 07:06 I'm not well versed in that, but I know there is an abstraction for that, called browser streams I think?
someone else can probably speak more intelligently regarding that; I only use firebreath as an API to a crypto backend, so my experience is rather limited.
thoys 07:06 ah oke
thanks anyway
need to get a stream into std::istream somehow
kylehuff 07:06 well I'm off, the others will probably begin rustling around in here soon. good luck mate!
thoys 07:06 ty, goodnight I guess ( depending on where you live)
wavey 08:06 thoys: I personally used CURL to download stuff. But have a look on SimpleStreamHelper
(I am still struggling with BrowserStreams :P :P :P)
taxilian 08:06 there is an example in FBTestPlugin on how to use it
thoys 08:06 cool ty guys
I think I will go with the BrowserStreams
wavey 08:06 If you just want to fetch something (no progress involved) they are perfect
thoys 08:06 want to do it as fast as possible, with least dependencies
wavey 08:06 I wanted to have progress events ...
thoys 08:06 ah ok, I dont need that, its like 100kb
taxilian 08:06 SimpleStreamsHelper is going to be easiest, then, thoys
thoys 08:06 is that easy to convert to istream?
wavey 08:06 You are registering yourself on a callback that gives you a byte buffer when it's finished
taxilian 08:06 no, has nothing to do with istream
wavey 08:06 You don't have stream access
taxilian 08:06 go look at FBTestPlugin
thoys 08:06 alright, as long as I get the bytes somehow then its ok
wavey 08:06 by the way, taxilian, I saw that the createStream( url, callback, ... ) interface is deprecated.
(that is used on the FBTestPlugin)
are you planning to remove it any time soon?
(in favor to createStream( BrowserStreamRequest ... )
(on FB::BrowserHost)
taxilian 08:06 not real soon
the other method is just cleaner
and more powerful
wavey 08:06 By the way, I can now successfuly download stuff (with progress feedback), but some resources are not properly released again :/
I am doing yet another step-by-step debugging again
I tottaly owe you a wiki entry when I figure this out XD
taxilian 08:06 sounds great =]
thoys 08:06 hmm "prep2010.cmd ../../plugin build" didnt work for me , but "prep2010.cmd C:\Development\Websites\Fixlogic\plugin build" did xD
taxilian 08:06 try ..\..\plugin build
in windows you need to use \
thoys 08:06 that feels wrong xD
taxilian 08:06 welcome to windows
thoys 08:06 i feel like im escaping lol
taxilian 08:06 that's normal to want to escape when using windows
thoys 08:06 but \\..\\ would work right?
taxilian 08:06 on the command line? I don't think so
thoys 08:06 let me try :D
muahaha
this did the trick "prep2010.cmd ..\\..\\plugin build"
in cmd.exe
taxilian 08:06 huh
surprised a double backslash works in cmd
thoys 08:06 maybe a tripple works aswell xD
ye lol
tripple works aswell
wavey 08:06 Yes an empty path component is ignored
also on linux
thoys 08:06 i bet it trims the path
ye
wavey 08:06 (unless it's first :P)
\\ is network location XD
thoys 08:06 does anyone know if the place where the plugin file is is the working directory by default?
wavey 08:06 m_filesystemPath
on PluginCore
it's where the binary file is located
I think the working directory is there
thoys 08:06 oke, hope so, have a test file i wanna print xD
wavey 08:06 You can create a temporary file
in env("TEMP")
thoys 08:06 ya, but i have the file already, i dont wanna put the full path to the file xD
wavey 08:06 ah, ok
thoys 08:06 will see, was just wondering
wavey 08:06 I always carry the full path, just to be on the safe side :P
thoys 08:06 I never, so i can report back the librairy maker or fix it when it fails xD
why do it the easy way if u can do it the hard way eh :D
diorcety 08:06 https://svn.boost.org/trac/boost/ticket/7506 appears with firebreath
wavey 09:06 hehe
I had to create a cross-platform, persistent store ... so I ended up carrying all the full paths with me XD
General C++ question : If you create a local variable in a { } code block... is it destroyed when the control moves out of that block?
taxilian 09:06 yes
this aint javascript ;-)
{ int i = 5; } // i no longer defined
wavey 09:06 (I'm on reference hunting mode) :P
ok, thnx
taxilian 09:06 useful for holding a shared_ptr only for a short time
wavey 09:06 yup, that's what I was thinking
but apparently isn't working ...
then I guess the reference is preserved somewhere else...
My best guess now is an event sink is preserved somewhere
I saw that you were using a StreamManager to hold a reference to the browserStreams
And I also saw that you were handling the onComplete event to release it...
thoys 09:06 but wavey whats the datatype of what ur defining?
wavey 09:06 (assuming that any previous callback handler returned true)
let me make a short gist
thoys 09:06 for pointers u might need to delete or release them in some way
wavey 09:06 Check this
https://gist.github.com/anonymous/99b5697b5cab07517b76
downloadText( )
The onStreamCompleted has the same code as onStreamFailedOpen
This code fails in two cases:
1) If I use the function, it completes successfuly and then try to unload the plugin -> I get an assertion that means I didn't release a BrowserHost pointer
wait
the 2nd is solved
(I had to return false on the onStreamCompleted handler)
nope, not solved :P
DefaultBrowserStreamHanldr.cpp, line 90
Expresion: false assertion failed
I am really running out of ideas :/
I can give a stack trace if u are interested XD
is X released out of this? : { FB::BrowserStreamRequest X; }
taxilian 09:06 your issue is when the download is in progress and things shut down?
wavey 09:06 nope
after download is finished
My guess is around FB::BrowserStreamRequest->setEventSink( shared_from_this() );
that's where I put a reference of the FB::DefaultBrowserStreamHandler
that contains a BrowserHost reference
The other culprit (if the FB::BrowserStreamRequest is indeed released when the block exits) is then the NpapiStreamPtr that contains a reference to the browser too
taxilian 09:06 sounds like those aren't getting released somehow
there should be a destroy call that releases them
wavey 09:06 You do a m_streamMgr->retainStream( stream )
But I traced that you successfuly do releaseStream on the BrowserStreamManager on onStreamCompleted
taxilian 09:06 hmm. do we release the eventsink at the same time?
actually the eventsink should be stored as a weak_ptr; is it?
wavey 09:06 since it comes from shared_from_this(), I guess yes...
taxilian 09:06 shared_from_this returns a shared_ptr
but you create a weak_ptr by assigning a shared_ptr to it
so it's the type that it's stored as
that you need to look at
wavey 09:06 ok, that might be the problem
taxilian 09:06 it would also explain why nobody else has seen your issue
wavey 09:06 Did anybody listen for progress events? :P
taxilian 09:06 didn't you just have to fix eventsink? don't think it was previously working
so nobody else was using it
would love to see a pull request that fixes SimpleStreamsHelper to support all of this when you're done
wavey 09:06 I fixed the SynchronousRequest for FB::SimpleStreamHelper
Not for the progress events :/
Hmm.... actually
hmmm ....
Damn...
I could add a progress event feedback on SimpleStreamsHelper, but it's incompatible with the current model that I use
For my current case I need a callback for every data chunk that arrives
Hmm.... extending the BrowserRequest sounds like an option though :P
taxilian 09:06 I'd love to see SimpleStreamsHelper support that usecase
wavey 09:06 let me hack ...
taxilian 09:06 or an alternate version
it's not an uncommon need
I just haven't had time to deal with it myself
wavey 10:06 ok, let me scratch my changes on FB core, because I think I added to much junk by now ...
I will keep a clean model I have in mind
I'll let you know if I manage anything today
taxilian 10:06 wouldn't call it critical, but it would be nice to see
think a lot of folks would find it useful
wavey 10:06 added HttpProgressCallback, HttpDataChunkCallback, HttpCompletedCallback ;)
I will test if everything works as expected in the evening ;)
tim1023 11:06 Hi all, I am having a terrible time getting FB plugins to load in IE (10) (on Win8). I can't even get FBTestPlugin to run. I've fiddled with IE's settings quite a bit to no avail. Anyone have any tips for how to "lower the drawbridge"?
Note, I've gotten other simple plugins from MSDN running on my current security settings.
The Microsoft Internet Explorer Compatibility Test Tool reports "ActiveX Blocking"
taxilian 11:06 tim1023: you need to disable activex blocking
http://ie.microsoft.com/testdrive/browser/activexfiltering/About.html
tim1023: you need to disable activex blocking
11:41
Guest88554 left the room (quit: Ping timeout: 245 seconds).

taxilian
IRC
http://ie.microsoft.com/testdrive/browser/activexfiltering/About.html
tim1023_ 11:06 ActiveX filtering is off.
tim1023 12:06 taxilian: I am pretty sure that I have ActiveX filtering off.
It's off in both the checkbox (under the tools menu) and also in the Internet Options
Also my internet settings permit other ActiveX components to work, but perhaps that's because they are signed (e.g. Quicktime, Silverlight, Adobe Flash).
I summarized this a little better and placed it here: http://stackoverflow.com/questions/17304860/activex-blocking-preventing-firebreath-plugins-from-loading-on-ie-10
taxilian 13:06 tim1023: you aren't trying to use it in the metro style interface, are you?
I'll have to look a bit later; headed to lunch now
tim1023 14:06 taxilian: I am using Desktop Mode
taxilian: also I scanned the API calls made (Process Monitor) and found the DLL never even gets opened or read...
tim1023 14:06 I also went through this page too: http://msdn.microsoft.com/en-us/library/dd565667(v=vs.85).aspx
taxilian 14:06 tim1023: it doesnt' sound like it's related to firebreath or the activex control
sounds like it's a configuration issue
but I don't know how to fix it
tim1023 15:06 taxilian: Could it have something to do with the component not be registered correctly? I regsvr32 it, and it shows up in the plugin lists in NSAPI browsers (about:plugins), but I don't know the process IE uses to look for ActiveX objects.
In any case, thanks for the comments.
taxilian 16:06 tim1023: are you using ie 64 bit or 32 bit?
diorcety 16:06 taxilian: hi !
taxilian 16:06 hello
diorcety 16:06 taxilian: i pull a request for firebreath-boost https://github.com/firebreath/firebreath-boost/pull/1
taxilian 16:06 right... so firebreath isn't currently using the master branch of firebreath-boost
which is where your pull request is
we're using 1.50.0
diorcety 16:06 indeed
taxilian 16:06 O
bleh
diorcety 16:06 on my side i use my own branch
taxilian 16:06 I'm also a little concerned about the fact that you're modifying boost itself
is this a fix that is found in a later version of boost?
so far boost has been kept pretty much stock
diorcety 16:06 https://svn.boost.org/trac/boost/ticket/7506
still opened
tomorrow i will try to update it
with a patch
but for the moment it can be a issue for someone using unique_path() and IE
taxilian 16:06 ahh
diorcety 16:06 it's not the best way ... but the quickest way