IRC Log Viewer » #firebreath » 2011-12-12

IRC Nick Time (GMT-7) Message
Fraser 09:12 hi
taxilian 09:12 g'morning
linearray 09:12 hi
Fraser 09:12 i am so very close to deploying my first firebreath created plugin and I hit a snag, hoping somebody can help me
Firefox on Windows seems to be blissfully unaware of my plugin object
plugin is loaded
but JS doesn't think the object exists
taxilian 09:12 how are you determining if it is available?
Fraser 09:12 my object id is avatools, so in javascript I just look for the avatools object
works fine in Chrome, Safari, IE
and quesry avatools.version
taxilian 09:12 immediately after adding the object tag? immediately on page load?
you should probably use the onload callback to tell you when it's ready
Fraser 09:12 on document ready (using jQuery)
taxilian 09:12 that may likely be too early
Fraser 09:12 when I look at the avatool object in the firebog console I get undefined
taxilian 09:12 firefox 4+ particularly on windows sometimes takes a bit longer to get it hooked up
Fraser 09:12 firebug
taxilian 09:12 okay; it may not even be loading, then
Fraser 09:12 it's been minutes :(
i do nothing on load aside from register some api's
taxilian 09:12 does it work on other windows browsers?
Fraser 09:12 yup, most of my testing has been Chrome and IE on WIndows
taxilian 09:12 hmm; I don't know why firefox wouldn't be working. have you checked about:plugins to make sure it shows up?
Fraser 09:12 Hmmm, firefox is reporting my version number differently
it must be loading an old one
I installed Firefox AFTER the plugin
taxilian 09:12 you didn't put a version in the plugins directory or anything silly like that, did you?
Fraser 09:12 nope
taxilian 09:12 well, that definitely sounds like an avenue to explore; if it's loading an old version somehow that'd do it
Fraser 09:12 ok, i'll go dig around
thanks for your help
taxilian 09:12 good luck
Fraser 09:12 i loaded this IRC room in firefox, now that seems like a mistake as I go restart browsers over and over :(
taxilian 09:12 lol
best would be to use an irc client, but you could just switch to IE or something =]
Fraser 09:12 will do
Fraser 10:12 I'm back
and still stumped
steps i've done...
1) verified that FF is pointing to the right plugin
2) loaded plugin with debugger attached, breakpoint in consutructor was hit
so it's loading something
no errors
taxilian 10:12 try putting your initial access in a setTimeout with 3000ms or something
sometimes I've seen FF freak out if you try to access the plugin too early
Fraser 10:12 i still cant even access it from the firebug console minutes after the page has loaded
taxilian 10:12 but when the page loaded it tried to access it, right?
remove that initial access
Fraser 10:12 ok
taxilian 10:12 so nothing tries to touch it when the page first loads
Fraser 10:12 Hmmm, removed all refs from my js code, still nothing :9
taxilian 10:12 :-/ I don't know
what version of FireBreath are you on? latest?
Fraser 10:12 1.6
taxilian 10:12 latest 1.6?
Fraser 10:12 latest from git
taxilian 10:12 hmm
I don't know, then :-/
Fraser 10:12 <object id="avatools" type="application/x-avalanchetools" width="1" height="1"> <param name="onload" value="pluginLoaded" /> </object>
that's all I have in my HTML
load page, open JS console, type "avatools", get undefined
same steps work fine in all other broswers
tried FF8 and FF4
taxilian 10:12 do you have a pluginLoaded function?
Fraser 10:12 yup, but it's empty
taxilian 10:12 and have you tried document.getElementById("avatools")?
just typing avatools is deprecated, has been for about 10 years (give or take)
linearray 10:12 do you have a window? i.e. are you sure the plugin doesnt just crash?
taxilian 10:12 see if the pluginLoaded function gets called first; add an alert or something
that will tell us a lot
Fraser 10:12 no window, it's just a trivial plugin that registers two JS functions to run some stuff on the local machine (plugin is for internal company use)
my pluginLoaded function hits
if calling the plugin by id is deprecated, what's the official way now?
taxilian 11:12 var plugin = document.getElementById("avatools")
Fraser 11:12 ok
taxilian 11:12 not just plugin, but *any* dom element by ID
tryt hat
Fraser 11:12 this is why video game programmers shouldn't make browser plugins ;)
taxilian 11:12 lol
actually, my friend, it is only one of many, many reasons… ;-)
Fraser 11:12 ok, now it works fine
taxilian 11:12 that's interesting
Fraser 11:12 i blame chrome, ie and safari for being lame and supporting 10 year old deprecated methods
taxilian 11:12 I would not have expected that it would simply not work; maybe ff finally decided to enforce the deprecation
Fraser 11:12 well thanks for all your help (again)
taxilian 11:12 you're welcome
good luck
Fraser 11:12 :D
sabotaged|wk 15:12 BrowserHost::getDOMWindow()->getLocation() -- is this suitable for checking if you only want your plugin to run from certain URLs?
linearray 15:12
so yes
sabotaged|wk 15:12 thanks
taxilian 15:12 sabotaged|wk: keep in mind that it doesn't protect against DNS spoofing or XSS attacks
sabotaged|wk 15:12 yeah
linearray 15:12 meh, now I have a cmake project to use in a cmake project
yo dawg.
taxilian 16:12 lol
ssdc 18:12 Hello - this isn't really an implementation question and not necessarily specific to FireBreath, but considering I've had good conversations here in the past, perhaps this question is still permissible ;) But anyway ... I'm wondering what is the standard or guideline for auto-updating plugins (both Windows and Mac)?
linearray 18:12 google omaha
/ Update Engine
ssdc 18:12 ok - I'll look at those.
taxilian 18:12 they are a pain, but probably the best option available
linearray 18:12 I wonder if rolling your own isn't simpler
taxilian 18:12 been there
done that
it's not
linearray 18:12 alright
taxilian 18:12 IMHO
ssdc 18:12 that's what I was hoping I wouldn't have to do :)
linearray 18:12 can you explain what the biggest stumbling blocks were?
ssdc 18:12 especially on Windows, seems like a cluster-f*#@ to implement
linearray 18:12 cause in my mind it seems pretty simple :)
in fact I guess I would do 100% in javascipt
taxilian 18:12 heh. but now you're updating in the browser
and everything just got 100 times more complicated
ssdc 18:12 well - I would say that doing it on OSX wouldn't be a big deal, right? You don't run into the same "file in use" and registry issues you would on Windows. You could just replace the .plugin and it'll get picked up the next time the browser is started.
I should add ... I'm installing my plugins in the user space, so it doesn't require admin rights
linearray 18:12 yes
taxilian 18:12 I will admit that we had fewer problems on Mac than on windows
and we did have it working
linearray 18:12 I think you can even replace it in the running browser fairly well
taxilian 18:12 but good heavens… it was a pain
much easier if it happens outside of the browser, automatically
linearray 18:12 my solution would contain plenty of 'divide by zero, navigator.plugins.refresh, window.location.reload'
taxilian 18:12 lol
ssdc 18:12 now ... on Windows, I noticed that the documentation states not to use regsrv32 to register the plugin ... why is that?
linearray 18:12 in fact, I would do that in a loop until I'm happy with the reported version string
ssdc 18:12 seems to work on the most part
as long as you store the updated version in a different path
taxilian 18:12 yes; you have to always put the new version as a different filename
on mac
windows it's best to put in a different directory
ssdc 18:12 right, but why is regsrv32 frowned upon in the documentation?
would that be a good strategy to pursue if I were to try building something on my own within the plugin?
taxilian 18:12 it's considered a Bad Idea to rely on self registering for an actual installation
better to use MSI if you can
ssdc 18:12 oh ... just for the installation you're saying
taxilian 18:12 or for update
ssdc 18:12 ok
taxilian 18:12 regsvr32 is great for testing
ssdc 18:12 gotcha ... any particular reason why? is it just not consistent?
taxilian 18:12 do a search on
there is a long diatribe that I've written several times about why
but I'm busy irght now =]
ssdc 18:12 sure ...
shenberg 18:12 hmm
FireBreathBot 18:12 shenberg: 08 Dec 15:57Z <taxilian> tell shenberg all instances of the plugin will always be on the same thread in a given browser; multiple browsers will each have their own process.
taxilian 18:12 lol. that message has been waiting for awhile
shenberg 18:12 I gave up on that a while ago - we hit on some bug in chrome, I think
raising an event while it was busy loading a different plugin
caused a deadlock on the tab
taxilian 18:12 you have to be a bit careful with anything that blocks on a thread
shenberg 18:12 even having an empty JS event handler was enough to cause that
taxilian 18:12 I'd need to know more about what you were doing; deadlocking a tab usually requires that your'e doing something you shouldn't do
unless you were using an older version of firebreath; there was a bug like that
back in 1.5 or so
shenberg 18:12 from version file: Last Commit Date: Wed, 2 Nov 2011 20:26:41 +0800
taxilian 18:12 what is the commit hash?
the next line?
shenberg 18:12 dc5bfc66eddc253ccedea62a61e42359580bece8
FireBreathBot 18:12 dc5bfc6 by doug mansell: FIREBREATH-137: fix log4cplus cmakelists.txt on non-apple pl
taxilian 18:12 nothing since then that would cause that
but I use javascript event handlers and such all the time; I'd have to see what you were doing, but you must have been doing something you shoulnd't
tabs don't deadlock just 'cause you're using javascript event handlers
shenberg 18:12 It isn't only because of that
we're also loading the Unity3D Web player
and if the event is raised while it's loading
then bad stuff happens
Happened once with flash too.
taxilian 18:12 dunno
shenberg 18:12 Anyway, I worked around that by not firing events when that's happening, since I have control over the usage of the plugin
Right now
I have a more troubling issue
My thread is leaking memory
I commented out all of the thread loop except for firing an event from it
and it's leaking like a sieve
taxilian 18:12 .pb
FireBreathBot 18:12 When you need to share code, logs, or anything else longer than a couple of lines, use a pastebin.,, and are all good options
taxilian 18:12 code?
shenberg 18:12
that's with most stuff commented out
onNewFrame() simply calls fire_NewFrame, where NewFrame is a no-parameter event declared with FB_JSAPI_EVENT. ZigJSAPI inherits directly from JSAPIAuto
taxilian 18:12 looking still
FYI, better to catch as a const FB::script_error&
more efficient
shenberg 18:12 Will do - haven't done C++ in a while - I've been spoiled by higher-level languages
taxilian 18:12 sorry, I'm trying to do 4 things at once here
linearray 18:12 hmm
isnt that busy waiting?
and arent you acquiring a gazillion locks on that mutex?
shenberg 18:12 huh? the actual code does things outside of the lock's scope but inside the loop
and leaks, it just takes more time
taxilian 19:12 yeah; the lock will release when it leaves that block
I'm not seeing anything obvious; I don't have much time today to try to help, I'm afraid
working on hitting a deadline this friday
shenberg 19:12 It's okay. I'll look into the FB code myself a bit
taxilian 19:12 there are no regular leaks related to firing events in FB; that's been tested pretty well
but something in the way you're trying to do cross-tab cross-instance events may be causing an issue
though I don't see anything obvious
shenberg 19:12 The problem is that I'm trying to feed data from a single device (Kinect) to potentially multiple tabs
and I need to guarantee calling its code ~30 times per second
or best-effort if the CPU is heavily taxed
Ideally, I wouldn't have a reader thread
taxilian 19:12 sounds like an interesting problem; wish I had more time to talk to you/help you with it =]
shenberg 23:12 I was about to ask
about a timer abstraction in firebreath
but then I saw