IRC Log Viewer » #firebreath » 2010-10-27

IRC Nick Time (GMT-7) Message
iaincollins 05:10 navigator.plugins.refresh(false); is the best thing EVER
better than girls.
(for some reason I couldn't find it in the documentation as was hoping there was an option for that)
So, now I have a happy old-version-detection and upgrade-without-browser-restart (or new window needing to be opened) in MSIE/FireFox/Safari/Chrome.
Once I've removed the cruft from it I'll post the JavaScript to a personal page on the Wiki along with steps I'd recommend to make to the already very helpful .wxs file to make it even more automagical
I have no experience of Mercurial and know a lot of stuff for 1.3 is happening so am wary of trying to submit any changes myself atm, so just going to document them
iaincollins 06:10 Now this is curious.. .Google Chrome (just installed; build 7.0.517.41) is returning a corrupt string (*looks* like wrong character encoding) as a result of a call to WinSock (Ws2_32.lib) *investigates*
iaincollins 08:10 Half the time I need to lookup something plugin specific it goes Google->Search Result From StackOverflow->Link to colonelpanic.net :)
taxilian 08:10 lol
sad, isn't it?
it's not like I'm the #1 resource in the world for plugin development... I'm just one of very few who has taken the time to write anything down
iaincollins 08:10 Agreed, it's very sparsely documented elsewhere
even the offical mozzila documention is pretty weak
if you belive it, for example, you /have/ to use their plugin delivery framework to have the browser auto-detect plugins (it's mentioned as "unique" feature)
with no mention of navigator.plugins.refresh() in the documentation at all, that I could find (although navigator.plugins is covered)
taxilian 08:10 well, you do, if you want the browser to do the autodetection
what you're doing is writing your own
iaincollins 08:10 Oh right, I see, they are handling the equivolent of the registry entries that the WiX installer inserts?
taxilian 08:10 no, they actually keep a registry of mime types to plugins
so if you use XPI for install, theoretically the browser can pop up a thing when you try to put an object tag of that mimetype on the page and prompt to download
iaincollins 08:10 hmm yes I see what you mean; and would be sans JavaScript I suppose, which would be a feature
(have written a javascript loop on the install page that pops up with a timer to check idly on the page for when the plugin is installed/the upgrade finished)
taxilian 08:10 yeah, that sounds pretty much like the way I did it last time I had need
I've been meaning to write something like that for FireBreath, but just haven't had the time/need yet
make sure you test it on windows vista w/ UAC; IE on that platform seems to be the most error prone
for instals
iaincollins 08:10 I'm only going to so much bother over the install/upgrade because of the use case (as a support tool for people who may be already taring their hair out and probaly not in the mood for putting up with having to install something in the first place)
yeah indeed; am using Vista / VS2008 for my primary dev environment (with MSIE/Safari/Firefox/Chrome open)
taxilian 08:10 right
are you developing with UAC enabled?
iaincollins 08:10 I am; it's going very well actually
(zero issues)
taxilian 08:10 good good
iaincollins 08:10 I was initially skeptical of WiX; I look at it before and thought "meh" too much hassle and went back to Orca..
taxilian 08:10 that's (IMO) the best way to develop plugins, since you'll catch most of the problems
iaincollins 08:10 but the kick start from FB has completly won me over
*nod*
taxilian 08:10 I was fairly proud of how that turned out
the funny thing is I haven't hardly touched it since I wrote it
which is why amackera is now the expert, even though I wrote it :-P
iaincollins 09:10 I can imagine how much of a detour that must have been from what probably seems like more "core" work of FB compatiblity
but it's been a huge timesaver at getting started
taxilian 09:10 building an installer was part of the original contract under which FireBreath was written
iaincollins 09:10 Oh
taxilian 09:10 ironically, I think very few people actually have used it
iaincollins 09:10 I didn't until you prodded me about it actually
and I'm very glad you did
taxilian 09:10 yeah; thanks for trusting me enough to try it =] most don't
iaincollins 09:10 I'm not sure you'd be entirely happy with how I'm choosing to handle version upgrades; but I am satisfied it works very well (in all browsers/multiple uses cases) though I do have a minor MSIE niggle
taxilian 09:10 how are you doing it/
iaincollins 09:10 I decided to go down the route of changing the DDL & Type with a version number on the end (e.g. myPlugin2.dll & applicaiton/x-myplugin-2)
taxilian 09:10 that's probably the "safest" way to do it
iaincollins 09:10 (with the MSI uninstalling old versions in a traditional way)
taxilian 09:10 it's just a little more expensive on the javascript side to keep up with the version numbers
iaincollins 09:10 I'm firing off a "CheckForUpdateToComplete" timer when the user elects to download; and detecting as soon as it's installed and it's working well
taxilian 09:10 right
I just mean that you have to have a list of all of the mime types to check for and such in javascript
iaincollins 09:10 interestingly I noticed the DDL/MIME type wth version number at the end approach is also what Google are using
I am currently checking for the current version; and then looping through mime.types with for (i=0; i < navigator.mimeTypes.length; i++) {}
(if it doesn't find the current version)
and doing a regex on the mime type to get the currently installed release
Which is slightly evil, but works well :)
taxilian 09:10 it should
when we add support for multiple mime types that'll probably help, because you can then use that to instantiate the base one if possible and then use the versioned specifically for the upgrade
iaincollins 09:10 (except in MSIE, of course, because navigation.plugins doesn't work; am just looking at seeing how to do the equviolent by invioking an ActiveX object on the page using your blog as a reference :)
taxilian 09:10 'course, depending on how everything is set up that may or may not matter
hey, I remember those posts; almost the first I wrote =]
iaincollins 09:10 I did wonder about how much hassle multuple mime types would be but decided I could dodge that
I don't expect we'll actually do many releases all the time; I just didn't want people to have a horrible experience (especially initially)
taxilian 09:10 it's going to be a little bit of hassle
but it will be doable
there is a guy working on removing the ATL dependency; I'm debating if I should wait 'til he's done or not before adding support
iaincollins 09:10 Oh? I would have /assumed/ it would be trivial; I think if he's going to go ahead with removing the ATL dependancy (so doesn't need VS I assume?) then yeah maybe leave it
taxilian 09:10 well, you have to realize that ATL is currently dealing with creating the window, setting up and handling basic system events, and probably the most critical it's what deals with the .RGS files for registry setup
doable? yes. trivial? no
else I would have done so long ago
iaincollins 09:10 It's still lagely a magic black box to me :-)
Which is great btw ;-)
taxilian 09:10 it is much more trivial that it would be simply because to get the flexibility that we need I've had to implement large parts of it myself
there is much of it that is still a magic black box to me as well, which is part of the problem =]
but yes, when writing plugins... it's great
iaincollins 09:10 gone through to some in depth info on the blogy about creating plugins from scratch
while duplication is bad, might be nice to have that as some info on the FB wiki too
or you could covert it to an ebook and sell it ;-) (</mercenary>
taxilian 09:10 hehe. yeah, I have a very long list of things I need to write
iaincollins 09:10 Regarding the last couple of lines on http://colonelpanic.net/2009/01/detecting-the-version-of-an-activex-ie-browser-plugin/
(Installing a new Plugin DLL while MSIE is still open)
I have a solution that detects if the old version is being loaded when it shouldn't be, and can display a link to open a new window (and close the current one)
but would be nice to know if anyone has a better suggestion (calling window.open() from a timer even't triggers the built in popup blocker in IE)
I am fairly sure this is arising because I am not doing what you explictly suggested and changing the CSLID (so tell me off if you think I am doing-it-wrong)
taxilian 09:10 I've been able to do it without changing the CLSID
iaincollins 09:10 but I am hoping to avoid that because I'd prefer not to for other reasons if I can dodge it
taxilian 09:10 or opening a new window
the mimetype change won't help you without a new CLSID, though
iaincollins 09:10 That actually works okay, but only if I open in a new Window
taxilian 09:10 shouldn't need to open a new window
iaincollins 09:10 although I have only been testing with MSIE 8
taxilian 09:10 granted, I've only tested the solution I had that didn't open a new windowon IE 6, 7, and 8
iaincollins 09:10 (in terms of IE versions...so far)
Oh!
taxilian 09:10 and never on anything older than windows xp
wait, no, we had it working on windows 2000 as well, but probably only with ie 6
iaincollins 09:10 *nod* yeah we finally dumped Windows 2000 as a supported platform this year
(and Windows 98 last year...)
Should you have any details to hand of how I might approach that, or suggestions at some point, would be interested (am continuing to investigate though, and it's workable as is)
taxilian 09:10 pretty much what we did is listed in that article, I believe
the only other thing we did previous to that is inject an object tag in, check the version, and remove it back out of the dom
that does bad things in IE 6, though, so should be avoided where possible
iaincollins 09:10 oh, that's good to know, about to try that this afternoon (on XP)
will read the article again (without skimming this time...)
taxilian 09:10 don't remember anything magical about it... bascially just every time you create a new instance of the ActiveXObject it should check to see if a new version was registered because of how COM works
I better go get ready for the day; still got 2 more math assignments to finish and a checkers AI to polish up, and I only have a few hours to do it all in :-/
I'll be on later
iaincollins 09:10 good luck :)
neilg_ 10:10 Hey everyone! Anybody know of a good way to test the plugins in multiple version of IE without using VMs?
I specifically need to test IE7 and IE9 support. I'd normally use a VM except that the VMs don't support 3D very well (or at least not the features we're using) so the plugin fails quite early
taxilian 10:10 unfortunately no
neilg_ 10:10 Bah. :)
taxilian 10:10 there are ways to get IE 6 working when you have a later version installed, but I don't know of a way to install multiple post IE 6 version
neilg_ 10:10 I have no idea why MS insist on upgrading browsers and not letting users have multiple versions installed...
taxilian 10:10 it's easier, probably
neilg_ 10:10 Only because they insist on having some/all of the IE DLLs in the system32 directories rather than using SxS properly. Or just having them to the side of the browser.
Oh well, I'm not the first nor will I be the last to complain about it :)
taxilian 10:10 =]
well, when you consider how much work I put into making FireBreath work on IE as smoothly as it does on Firefox, I think you'll not be surprised to hear that I have my own set of frustrations with it =]
iaincollins 10:10 neilg_ No :( But if you are using DirectX then VMware has quite good support with specific Windows versions (and DirectX 9); it's pretty robust and nippy too
(e.g. 100 FPS for an MMO like WoW on a MacBook Pro)
neilg_ 10:10 taxilian: You have frustrations with IE? Who'da thunk it? :)
taxilian 10:10 I know, shocking, isn't it?
neilg_ 10:10 I'm using VirtualBox. I could try VMWare but I'm not sure how much better it will be.
Things may have changed but I believe VirtualBox and VMWare were using the same source to do the DirectX -> OpenGL translation which is the source from WINE
taxilian 10:10 VMWare with DirectX stuff will be *far* better than virtualbox
in my experience
neilg_ 10:10 But I read that maybe 2 years ago (scarily!) so it may well be different
taxilian 10:10 that said, it still won't be nearly as good as normal hardware
they've made huge strides in DX support on vmware (at least with Fusion) in the last 2 years
neilg_ 10:10 Because WINE has too. ;)
iaincollins 10:10 neilg_: I wonder if that's the default (non hardware accelerated) support
neilg_ 10:10 I should try it though and see - instead of relying on circumstantion evidence.. at best!
*circumstantial
taxilian 10:10 nah, that takes all the fun and guesswork out of it
iaincollins 10:10 The "accellerated" 3D support has to be explicitly enabled, but I've been very impressed wiht it
neilg_ 10:10 WINE is truly amazing with 3D games - I've been playing Planescape: Torment using Crossover
I also have VMWare Fusion and I didn't notice any speed differences. But it's not like that's a terrific test either. ;)
iaincollins 10:10 Yeah I must say I've been impressed with the performance of a few MMO's using it
taxilian 10:10 cygmatic_: You got casting from a JSObject back to a JSAPI object working?
cygmatic_ 10:10 yup
have to think about how to integrate that into the auto conversion stuff
taxilian 10:10 yeah, that'll be the trick
still, very cool
well done
cygmatic_ 10:10 maybe you know wether casting to CFBControl actually makes sense though? http://code.google.com/p/firebreath/source/browse/src/ActiveXPlugin/IDispatchAPI.cpp?repo=dev#307
taxilian 10:10 hmm
both of those inherit from JSAPI_IDispatchEx, but that's a templated class (unfortunately)
so that might be the best way to do it
cygmatic_ 10:10 yup, but i haven't tested yet wether you can actually get the plugin object itself passed
works fine with other objects though as the FBTestPlugin/test.html shows
taxilian 10:10 hmm. that is a very interesting question
I do not know the answer
another trick we really need to get figured out is how to get a JSObject for the object tag we're hosted in
it is easy in NPAPI, but I'm not sure how to do it in ActiveX
cygmatic 11:10 hm, no idea either
dicroce 11:10 Hi... Just started looking at firebreath this morning, and already i have a plugin... :)
taxilian 11:10 pretty cool, huh?
dicroce 11:10 yeah... i like this projects attention to detail...
actually having a tutorial that works...
documentation...
stuff usually lacking from open source projects... everything built and worked for me the first time so far... :)
taxilian 11:10 hehe. yeah, we've been really trying to improve that, particularly recently
if you do find anything confusing, btw, you can get an account and start editing wiki pages right away
dicroce 11:10 cool...
taxilian 11:10 what are you trying to do with it?
your plugin, that is
dicroce 11:10 ahh...
well, I work for a video surveillance company... we're looking at maybe doing more browser based interfaces in the future...
so, we're considering running our media pipelines inside of browser plugins...
so, video...
btw... how is firebreath licensed?
I haven't even looked at that yet...
taxilian 11:10 dicroce: FireBreath has a dual license
you can use it under New BSD or LGPL
dicroce 11:10 cool...
perfect...
taxilian 11:10 sounds like a cool project
should be quite doable
cygmatic 11:10 yep, might be similar to the video-conferencing plugins i've done
dicroce 11:10 the primary thing we worry about is low latency...
in the video that is...
the security industry makes a big deal about really low latency video...
taxilian 11:10 well, the main challenge you'll have is proxies
dicroce 11:10 so, we end up doing our own decode and render pipelines to make that happen...
taxilian 11:10 there is really no good way to detect browser proxy settings, at least until Firefox 3.6
dicroce 11:10 Ahh, well likely this plugin will be used on private lans...
not across the internet... (at least not at first)...
taxilian 11:10 but as long as you can get the data there, displaying it with low latency is simply a question of how well your display code works
dicroce 11:10 yup...
taxilian 11:10 more or less just like a windows app
if you wanted to be able to use windowless (so that HTML elements could draw over your plugin), that'll slow you down a bit, but still probably doable if you use the 1.4 dev branch
dicroce 11:10 we have a video pipeline... I'm really just trying to host it in a browser plugin...
ahh...
taxilian 11:10 main challenges that tend to crop up with putting an existing system into a plugin is the lifecycle bit; if you have any global or static variables, you probably want to eliminate them
otherwise you'll probably be fine
let us know if you have any questions
dicroce 11:10 hmm...
cool...
well, right now, i'm trying to figure out how to get at the window handle...
taxilian 11:10 and if you have a blog or anything, feel free to share your positive experience with the world ;-) we can use the publicity =]
dicroce 11:10 Cool...
taxilian 11:10 what OS? windows?
dicroce 11:10 It looks like onWindowAttached() is passed a FB::PluginWindow... but I don't really know where to go from there... yeah, on windows...
taxilian 11:10 you'll want to abstract this more in the long term, but the PluginWindow you'll be given is a FB::PluginWindowWin
http://www.firebreath.org/display/documentation/class+FB+PluginWindowWin
So you can either do your own dynamic_cast of it (or use ->get_as<FB::PluginWindowWin>) or just change the type in the event map
so that it'll cast it for you
but when you have it as a PluginWindowWin you can call ->getHWND: http://www.firebreath.org/display/documentation/class%20FB%20PluginWindowWin%20getHWND#adda2e266145ed43d5e3b91cebee2fd00
dicroce 11:10 Cool...
taxilian 11:10 if you get to where you want to make things platform specific, the easiest way is to subclass your plugin class and do platform specific stuff there
dicroce 11:10 Do i need to add an include path to the project to include "PluginWindowWin.h" or is there some path prefix I should use when including that?
taxilian 11:10 the include path will be there, but it'll be "Win/PluginWindowWin.h"
look at BasicMediaPlayer for an example
dicroce 11:10 ahh... cool...
Yeah, our rendering pipeline is already cross platform (window and linux), it just needs a window handle on both platforms...
taxilian 11:10 linux will be trickier; the abstraction is not nearly as solid on linux as it is on windows, since we don't have anyone "on staff" who really knows how drawing in linux works
so you might have to help us out there a bit =]
neilg_ 11:10 dicroce: You'll be fine. I'm using FB to render 3D graphics using Direct3D - it all works really well
taxilian 11:10 which plugin class gets used depends on what your Factory returns
well, I'm off to class. be back on in an hour or so
dicroce 12:10 Ok, so we shouldn't edit .vcproj files directly, correct? Instead, if I need my project to link against an external library I should edit the CMakeLists.txt file?
neilg_ 12:10 Yes
You can edit the vcproj files but it's a bad idea - because if you have to regenerate them again using CMake then you'll lose all your changes
dicroce 12:10 i guess I need to read up on cmake...
neilg_ 12:10 I can help you a little, I was just doing this yesterday
So FireBreath creates a projects directory for you and that's where the code for you plugin goes. Assuming you're building for Windows inside your projects\<plugin> directory you'll see a Win directory. Inside there you'll find a projectDef.cmake
In there you can add "target_link_libraries"
I link against a library called Sandstone so I have 2 lines like this:
set (SANDSTONE_DIR ${FireBreath_SOURCE_DIR}/external/sandstone/lib)
target_link_libraries(${PLUGIN_NAME} debug "${SANDSTONE_DIR}/debug/sandstone.lib")
The debug on that second line specifies that it only links that library for debug build configs. You can get rid of it if you always want to link against that library
FireBreath_SOURCE_DIR refers to the directory where the root CMakeLists.txt resides
That should get you going pretty quickly
taxilian 13:10 dicroce: keep in mind that the difference between CMakeLists.txt and projectDef.cmake is just that projectDev.cmake is platform specific and your CMakeListst.txt is project-wide
cygmatic 13:10 dicroce, if you haven't seen it yet, take a look at http://www.firebreath.org/display/documentation/Using+Libraries
dicroce 14:10 Cool... thanks... So you can specify target_link_libraries in CMakeLists.txt as long as the libraries are not platform specific?
taxilian 14:10 yes
dicroce 14:10 Thanks for the help with this... I have a meeting right now, but I'm going to try this out as soon as I get back...
taxilian 14:10 have fun
neilg_ 16:10 Who knows about browser streams?
I've requested the browser download a stream for me by calling m_host->createStream(strURL, this);
But when I get into NpapiPlugin::NewStream(NPMIMEType type, NPStream* stream, NPBool seekable, uint16_t* stype) the stream paramater is NULL but returns NPERR_NO_ERROR so the browser just waits... forever.
Actually, that's incorrect - stream isn't NULL but stream->notifyData is
I'm not sure where notifyData would be set (and why it isn't)
taxilian 16:10 that would be a nitrogenycs question, and he isn't here
it's on my list of things to do, but haven't had a good reason yet
neilg_ 16:10 ...it looks like a browser bug with Firefox
At least on the surface it does
NPNFuncs.geturlnotify(m_npp, url, target, notifyData) is called and notifyData has a valid pointer to a NpapiStream
But when the browser calls back into NpapiPlugin::NewStream(NPMIMEType type, NPStream* stream, NPBool seekable, uint16_t* stype) stream->notifyData is NULL
If I do the horribly bad practice of setting stream->notifyData myself in the debugger back to the correct value... it all works
taxilian 16:10 odd
try it on a different browser
neilg_ 16:10 It works in IE, that's why I think it's a browser bug
And that's very frustrating given usually it's IE that's broken ;)
It also appears to be a server thing too because it WAS working with a completely different server. So yes, I'm now very confused
Hmm, maybe not - because it does the same in Opera
So it's somehow a server thing?! Weird
Yes, that's actually it. Seriously... WTF? That's bizarre behaviour!
I can go to one server and streaming files works fine and stream->notifyData isn't NULL - but the same HTML requesting a stream from another server results in stream->notifyData being NULL
That's just... just... wow.
lol
taxilian 16:10 neilg_: keep in mind that IE uses a completely different back-end implementation for BrowserStreams
neilg_ 16:10 Right, I already traced through that code so I think I roughly understand what it's doing
taxilian 16:10 some servers don't support byte range requests, etc, so it could be that the type of stream you're trying to create just isn't supported by that server
neilg_ 16:10 Oh, I have the headers - I get those just fine
What's weird is that code that's been working all day now doesn't so maybe there's some kind of weird connection issue too?
taxilian 16:10 haven't a clue; I haven't used that code yet :-/
neilg_ 16:10 I have to stream in two files - and now the second file is having the same behaviour
Sure, that's fine... I'm just... puzzled. :)
taxilian 16:10 in 1.4 I've added a json parsing library; I'd really like to add a web services library to use BrowserStreams to cover common use cases
neilg_ 16:10 Right now the only browser that works is actually IE - it's an irony that isn't beyond me :)
Which json parsing library? I really like cajun
It's looking like I'll have to use libcurl to get these files reliably which is a shame but...
taxilian 16:10 neilg_: can't remember which lib it was, but I picked it because it seemed decent to use and the code was public domain
neilg_ 16:10 Well, I know I tried a couple but really liked cajun - it made clever use of C++ to make using JavaScript objects about as easy as within JavaScript itself
taxilian 16:10 it's tempting to go through this one and integrate it more fully into FireBreath; use variant and the auto conversion stuff, etc
tie it into JSAPI
but then we'd have to maintain it
neilg_ 16:10 That would be cool. And yep, that's the downside
Right, I have to get going - I'm already 2 hours late. Oops.
Damned bugs. I can't stop when I find one!