IRC Log Viewer » #firebreath » 2012-07-12

IRC Nick Time (GMT-7) Message
cluze 00:07 hello?
emicastro 07:07 taxilian_away: ping
emicastro 08:07 if I insert the <object type=<myPluginType>> from the javascript through the document.body.appendChild method, Can I assure that the plugin is initialized right after do that?
I have the problem, in some browsers, that after insert the <object> I try to retrieve the plugin with document.getElementById and this are returning me null, because the plugin instance is not initialized yet (I supose that)
jshanab 08:07 Can the plugin determine which browser it is running in?
jshanab 10:07 A question about the git rep. I see master, 1.6 and 1.7 branches. Is master the most recent and 1.6 and 1.7 are maintanence branches
taxilian 10:07 1.7 and master should be the same
emicastro: you need to pass a param onload and then the plugin will be instantiated when you get the callback
jshanab: you can check the useragent
jshanab 10:07 Excellent. thanks. So I have updated and there have been a few changes. My old generated np_winmain.cpp complains that Default is not a member of FB::Npapi:NpapiPluginModule. I think i was on 1.5 Is there a list of breaking changes for 1.7 yet?
taxilian 10:07 1.7 has no breaking changes
delete your np_winmain.cpp file
you don't need it anymore
jshanab 10:07 awsome
taxilian 10:07 unless you're customizing it somewhere
emicastro 10:07 ok... I understand that.... but... I dont know if this solve my problem...
This is the problem
on IE8 and some other version of Chrome or Firefox... the inyection of the <object > into the body through the javascript, is not reflected in the moment after that I do the appendChild...
taxilian 10:07 and that will never change
that's a browser issue
however, you should also know that it is a really bad idea to create the object and then inject it into the DOM like that
much better to use innerhtml to create the whole object at the same time
if you do for some reason insist on creating the element and appending it, at least wait to set the mimetype until after you append it to the DOM
however, the solution to your issue is to inject the plugin, then wait for the callback to occur and finish your javascript when it gets called
optionally including some sort of check on a timeout in case it doesn't instantiate
emicastro 10:07 ok, but the inject of the plugin, is not working... because the browser doesn't reflow the DOM instantly... I mean... when I do the appendChild, the plugin doesn't start the initialization until the browser insert the <object ....> to the .html
the plugin starts the initialization when the <object type="myplugin"> is on the .html or when I add the <object type="myplugin"> with the appendChild?
taxilian 11:07 when it is in the DOM and visible
In IE that isn't always totally true
it sometimes does a partial init when you create it and set hte mimetype and then deactivates and reactivates when you make it visible
which complicates things greatly
and is the main reason I recommend against doing that
emicastro 11:07 so, this is that I'm injecting <object id="app" width="1" height="1" type="application/x-appup"></object> to the body.... with the appendChild. At this time, IE doesn't insert the tag into the body... but the object plugin is not null... buttt... the method of the plugin doesn't work... I don't know why..... The method can be access when the IE insert the whole line in the body...
I explain myself?
taxilian 11:07 … appendChild doesn't work with an HTML string, so maybe I'm not understanding?
emicastro 11:07 well... sorry... I create an element... and then insert it with the appendChild
taxilian 11:07 right
I'm telling you that that is a Bad Idea
emicastro 11:07 ok... first thing to change
innerHTML insted of appendChild
taxilian 11:07 correct
emicastro 11:07 ok
taxilian 11:07 the second thing to change is your perception that there is some reason that the browser will allow you to access the plugin the next line after you insert it
it wont'
or at least, it won't always
emicastro 11:07 oh... ok
taxilian 11:07 it depends on the browser and the situation and possibly the position of the moon (though I can't prove that)
emicastro 11:07 hahahaha
taxilian 11:07 thus instead of trying to access it immediately, wait for the callback and do it then
emicastro 11:07 ok, wait for the onload callback?
taxilian 11:07 yes
emicastro 11:07 ok, I will try this... I hope this solve my cross-browser issue
and then I will let you know! :)
thanks again!
taxilian 11:07 sounds good. good luck
emicastro 11:07 I'm thinking in be part of your project... ! :)
emicastro 11:07 taxilian: this kind of callback document.getElementById("plugin").attachEvent("onload", onPluginLoad); ?
taxilian 11:07 no
a param
look at examples/FBTestPlugin/test.html
emicastro 11:07 ok
emicastro 11:07 the onload event, should be declare exlpicitly in the plugin? or allways is fire?
taxilian 11:07 it's not a real event
it's just a special param that you specify
and that will be called by FireBreath when the plugin starts up
nothing you need to do special in the plugin
emicastro 11:07 sorry, I don't understand.... the <param that you declare into the <object will be called from the plugin ?
taxilian 11:07 the function with the name you provide in the object tag will, yes
go look at the example
emicastro 11:07 I'm seeing the example, I'm tring to understand the flow
taxilian 11:07 ignore the onload="alert" crap
that doesn't work
it was a security risk
not sure why that is still there
look at the param name="onload"
emicastro 11:07 yeah
taxilian 11:07 then notice that there is a global function called pluginCB; for the first plugin instance that's what gets called
emicastro 11:07 yes, the var pluginCB
that has the value of the callback
that is pluginLoaded
taxilian 11:07 nothing magic in that value stuff; that's just how javascript works
you just need a global function; specify the name of that function in the onload <param and it will be called
emicastro 12:07 Let me try.... :) I'm sorry
jshanab 13:07 Is there an example showing how to use keyboard events?
taxilian 13:07 not that I know of
rcompton78 14:07 I have been deploying my company plugin in a chrome crx. I would like to start using the wix project stuff included in firebreath. I have running into the ICE38 error on building the installer. I have read on some doc pages and forums that delayload might help. Does anyone have any insight into that whole issue?
taxilian 14:07 do you have any external DLLs that are required?
rcompton78 14:07 yes we do. One
It seems to be bombing on the actual plugin dll though
taxilian 14:07 right
because if you're linking to it then it's trying to LoadLibrary the DLL when it first loads the plugin dll
so the easiest way to resolve that is to delayload your dll
rcompton78 14:07 delayload the plugin DLL?
or the dependant dll
taxilian 14:07 no, delayload the dependent dll
rcompton78 14:07 ah that makes more sense. I was reading you documentation and then you say to load it manually, I was completely confused when you said to load manually (I thought the plugin DLL) and that is impossible
Are there other ways?? I also read somewhere about setting the proper IDs for the components or something wix related
taxilian 14:07 there are a couple of things that will cause that error
but in this case the problem is that heat.exe is unable to load the DLL and thus unable to correctly build the include that tells WiX how to register the plguin
so you need to resolve that issue
rcompton78 14:07 ahh I was wondering why it needed to load (of find) the dependant DLL's. It is for the registration
So then I would load my dependany DLL manually after ?
taxilian 14:07 if you delayload it then it will not be loaded until it is needed
since it isn't needed for registration then you're good until it's being used in the browser and calls a function on the DLL
bad news is if it can't find that DLL at that point it will crash
so make sure it can =]
I gotta head to lunch
be back in an hour or so
rcompton78 14:07 thanks for the help. Enjoy
jshanab 14:07 Event handlers put in the event map generally have a signature that returns a bool. Is this bool used? like true = i handled it and false = pass it on?
nevermind. I see it
taxilian 15:07 jshanab: yep, correct
jshanab 16:07 I have been using SDL (using directX) and with the update to ie9 now any resizing crashes IE. It of course works in FF, etc. IE added 2d accceleration and of course they use directX. Anyone have any ideas?
taxilian 16:07 nope, but it sounds like a fun problem. I'm sure you'll just have a blast tracking it down
jshanab 16:07 I just got 90% of the plugin workin on the iphone. a Dream by comparison to IE problems. OPENGL ES in the plugin ???