IRC Log Viewer » #firebreath » 2011-05-16

IRC Nick Time (GMT-7) Message
dougma 00:05 anyone having problems with ActiveXBrowserHost::evaluateJavaScript throwing "Can't execute JavaScript: Window is NULL"?
happening via setReady
(and not the result of my issue 68 patch)
somewhere after issue 63 patch
dougma 02:05 yes... crash occurs when I dynamically create the control (document.createElement style)
FireBreathBot 02:05 JIRA issue issue created by noantz
graykos 02:05 anyone?
FireBreathBot 02:05 JIRA issue issue updated by noantz "I have added a patch for fix :P"
JIRA issue issue commented by noantz "I'm sorry but the attached patch includes some changes from boost library merge, revert all boost..."
graykos 03:05 anyone alive?
jshanab_wcw_ 06:05 I don't know, let me check my pulse
chminx 07:05 hello, I'm alive :)
sorry about this, I'm a completely newby at NPAPI and I though i'd ask a question
however, I dont' want to sound too stupid so I'm actually looking at soem examples trying to figure out the answer myself befor eI bugu you guys
mastropinguino 08:05 Hi all
FireBreathBot 08:05 mastropinguino: 12 May 15:35Z <taxilian> tell mastropinguino search for opengl and mac and you'll probably find things. The gist is that it's a pain in the neck and you'll need to use CoreAnimation. Search for that as well
mastropinguino: 12 May 15:35Z <taxilian> tell mastropinguino search for opengl and mac and you'll probably find things. The gist is that it's a pain in the neck and you'll need to use CoreAnimation. Search for that as well
mastropinguino 08:05 in last 3 days i search hardly on google/ and even in firebreath forum and irc logs but i can't find anything.. my problem is with vtk + mac plugin ... vtk use a NSView to render surface and I can't put that NSView in browser
neilg_ 08:05 Hey all
mastropinguino 08:05 Hi
chminx 10:05 hello
anyone here ?
taxilian 10:05 yep
chminx 10:05 Hello :)
taxilian 10:05 but really around here your luck will be better if you just ask a question and then stick around long enough for one of us to come back and answer it
chminx 10:05 I'm a newby to NPAPI, so please excuse my ignorance :)
ah, tight :)
taxilian 10:05 ignorance is not a problem. Blind stupidity is… for that we shoot people. Ignorance doesn't bother me, though =]
chminx 10:05 anyway, I was wandering if you knwo if it's possible to have several NPobject per plugin ?
and if it is, how to do it ?
taxilian 10:05 yes and yes
chminx 10:05 from what i see, NPP_GetValue( only returns one object
so, how do I tell th e browser taht UI have several ?
taxilian 10:05 any reason you're not just using FireBreath?
chminx 10:05 I'm supposed to developm my own
taxilian 10:05 what for?
chminx 10:05 not sure if I'm allowed to use FireBreath
fit's for an embedded device
taxilian 10:05 let me put it this way; FireBreath has the combined experience of several developers who have been working with browser plugins for years in it. It's not an easy learning curve. There are a lot of inconsistencies. If you can use FireBreath, it'll save you a lot of hassle
but it's your call
chminx 10:05 :)
I appreciate that... but I have to do it this way :)
taxilian 10:05 all you need to do to have multiple NPObjects is to return the other ones in response to method or property calls on the main one
chminx 10:05 I can see it's not an easy field to learn :))
taxilian 10:05 have you read ?
chminx 10:05 I have, but I didn't see it there
did i miss it ?
oh, is it saying taht I can call NPN_CreatObject ?
taxilian 10:05 probably not; I wrote it 2 years ago, so I probably dont' remember everything that's in it. I should read it sometime. Mainly just making sure you got the basics
chminx 10:05 oh, you are t colonel panic ?!?!?
taxilian 10:05 you can call NPN_CreateObject and then store the resulting NPObject* in a NPVariant to pass to the page
I am Richard from colonelpanic
chminx 10:05 that blos is the best thing I found on NPAPI on the net
thank you for that :)
taxilian 10:05 make sure you've read this one too:
chminx 10:05 anything I do know comes from that blog
yeah, read that one too :)
taxilian 10:05 heh. that's pretty sad, really, but that's why I wrote FireBreath
chminx 10:05 I'm honoured :)
taxilian 10:05 so when I tell you it's easier to use FireBreath? I wouldn't write a raw NPAPI plugin without using FireBreath if there was any way I could avoid it.. and I more or less know how to use NPAPI
chminx 10:05 thanks for helping me out :)
so, how does the browser know which object to invoke the has_method on ?
taxilian 10:05 how well do you know javascript?
it acts more or less just like any javascript object
chminx 10:05 hmm... medium, I'd say
taxilian 10:05 something like:
var plugin = document.getElementById("myplugin")
var obj2 = plugin.getSecondObject()
it calls Invoke on the main NPObject with getSecondObject as the identifier; that function then creates a new object (or retains one it already has created) and returns it in a NPVariant
then you just call obj2.doSomething() and it calls Invoke on the second object
because that's what you called it on
just realize that all javascript objects are, in NPAPI, an NPObject
you can pass javascript functions in as parameters and they come through as a NPObject
chminx 10:05 does that mean that the "plugin" in the plugin.getSecondObject is the name of my plugin ? so I would have to have plugin.first.somemethod() and plugin.second.getmothermethod() if I have several NPObjects ?
taxilian 10:05 plugin in the plugin.getSecondObject is just a javascript variable that was fetched with document.getElementById
in other words, it just refers to the DOM element of the plugin
all calls to that DOM element go to the main NPObject
you can only have one primary NPObject, as you have noticed; NPP_GetValue only returns one NPObject
so you could have plugin.somemethod() and plugin.second.anothermethod() if you wanted; you just need a property called "second" that returns another NPObject
you may want to play with FireBreath a bit and see how it works with JSAPI objects; it may help you understand better what is going on underneith
chminx 10:05 so, if I want to have object1.dosomething() and object2.dosomethingelse() without that leading identifier, I basially need two plugins ?
taxilian 10:05 I don't think you're getting this… an object is just an object
it doesn't have a name, in Javascript
chminx 10:05 wel,, I would give it a name
taxilian 10:05 if I say object2 = object1, I have two names
but one object
chminx 10:05 I know
but I want to have 2 objects created.. object1 and object2
and I want to invoke different methods on those two objects
taxilian 10:05 if I say object1 = document.getElementById("someObjectTagId") then object1 will be my main NPObject; my root object, as I call it
then I could say object2 = object1.getSecondObject() and have getSecondObject return a NPObject and now I have two objects
if you absolutely must have two objects at the same level, you could have the "root" object do nothing but return one or the other of the child objects
it's totally up to you
you can do whatever you want
but you don't have to create a second plugin just to have multiple objects
chminx 10:05 I knwo I'm being difficult, but I think we are talking about 2 different things....
taxilian 10:05 okay… please try to explain
chminx 10:05 I'll do my best
so, I want to have tewo "keywords" in my plugin... if someone says coffee.drink I would have a Coffee object created and method drink called on it... If they say I would create a Sandwich object and invoke eat on it
at the moment , in the example taht I have, it lokos like coffee is registered agains the plugin with the NPN_SetProperty
not sure if tha's what it';s doing
so the browser knows to call coffe.drink on my plugin
is that making sense at all ?
taxilian 10:05 well, it's making sense that you don't really understand how NPAPI works… =]
chminx 10:05 :)
I'm so sorry :)
taxilian 10:05 I really, really, really, really, really think you should look at using FireBreath for your plugin
have you ever actually implemented an NPObject?
chminx 10:05 I'm trying to.. I have an example, but I'm not sure the person taht wrote it understands it either
let's try and rephrase the question
NoAntzWk 10:05 Hi Taxilian, I have added FIREBREATH-69 bug and I have added a patch with fix (at least in my scenario). I have kept the same philosophy and allow the user to handle WM_MOUSEACTIVATE message (but you have to be careful with the values ​​that are returned). Feel free to review it!
FireBreathBot 10:05 FIREBREATH-69: Summary: Incorrect windows focus management for Window's platforms
FIREBREATH-69: Assigned To: richard
FIREBREATH-69: Priority: Major, Status: Open,
taxilian 10:05 NoAntzWk: yeah, I saw it. I'll take a look at it soon(ish)
chminx 10:05 thank you for helping a maiden in trouble :)
taxilian 10:05 heh.
chminx 10:05 so, how does the browser know that coffee.somethigns has to go to my plugin ?
taxilian 10:05 so when you implement a NPObject, you create a NPClass structure with function pointers; with me so far?
chminx 10:05 yes
taxilian 10:05 ok. To call a method on that NPObject from javascript, assuming it's the root object (the one returned by NPP_GetValue), you get a reference to the object tag and then call a method on it
NoAntzWk 10:05 One question.... One question.... Is there a known issues for FB 1.4.3 about excessive consumption of CPU and memory?
taxilian 10:05 so if you have <object id="fred" type="…"></object> you'd get the reference with:
var plugin = document.getElementById("fred")
NoAntzWk: there are a few possible issues, but it depends on what your'e doing
I highly recommend updating to 1.5.1
chminx: thereafter, when you call methods on plugin, which now refers to the object tag, they get forwarded to the NPObject you returned from GetValue
if a function is called, your Invoke function pointer from the NPClass is called
if a property is requested, GetProperty is called
chminx 10:05 that's all cool
taxilian 10:05 if a property is assigned to, SetProperty is called
chminx 10:05 I understand that
taxilian 10:05 good
that's how it knows to make those calls to your plugin
nothing more to it
so in this example, coffee.drink() woudln't go to your plugin
NoAntzWk 10:05 I mean, using my plugin compiled in debug mode there is a growing consumption of cpu using FF4 and Chrome, however this does not happen in IE.
taxilian 10:05 however, you could set up GetProperty so when the "coffee" property is requested GetProperty returns a different NPObject
NoAntzWk: what is your plugin doing? and seriously, there are a ton of fixes in 1.5 and that might easily fix it
chminx: so if you call after that, GetProperty returns another NPObject…
so you could do and it would call Invoke on the second object
with me?
chminx 10:05 yes I am
I'm just thinkging
and the clogs are turning slowly :)
on teh test page that I have there is nothign like that, I just wnader if NPN_SetProperty can be used to do set something like <object id="fred" type="…"></object> on the test page document , even though I don't see it in my example
which might be my missing piece of teh puzzle
taxilian 10:05 no
chminx 10:05 :(
I'm going to cry
NoAntzWk 10:05 Basically my plugin send received WM_* messages to external process. In addition to this, there are a polling from JavaScript calling plugin methods (it's not possible to use FB callbacks because the external process generate "event").
taxilian 10:05 NoAntzWk: you could use something like named pipes to connect back into your plugin and send events that way, which could then generate javascript events
but there are several improvements in memory usage efficiency in 1.5; update, see if you still see the issue, then I'll see if I can help if you do
chminx: plugins are not instantiated until an object tag is put on the page
or an embed tag, but those are inconsistent across browsers; I don't recommend using them
chminx 11:05 ::)))
that's teh one they use here
taxilian 11:05 change it
chminx 11:05 the embed tag...
damn, I'm in trouble
taxilian 11:05 or not; up to you, but I would change it
if anyone argues with you, tell them to come talk to me
chminx 11:05 :)))))
NoAntzWk 11:05 My implementation aren't using names pipes, it uses shared memory and events to signaling (I known that is not a good choice and I will change it).
chminx 11:05 you are really being great... thanks... if you have to leav at any time, please do .. I'm just trtying to extract as much information as I can.. can't blame me for that :)
taxilian 11:05 NoAntzWk: nothing wrong with that; I'm just suggesting a way you could add onto that and get events back into the browser. rule #1 is always: do what works
NoAntzWk 11:05 :)
taxilian 11:05 chminx: I'm here most of hte day most days. I do need to mostly get back to work, though; see what you can do with that, feel free to ask when you have more questions. others here also know NPAPI fairly well, when they are around
NoAntzWk 11:05 I'm watching the running plugin on FF4 and plugin-container.exe consumes 77Mb and growing!
taxilian 11:05 NoAntzWk: there was a memory leak in the 1.4 branch, but I thought 1.4.3 had it fixed… seriously, though, upgrade
and did I mention that upgrading would be a really good idea?
not sure. on an unrelated note, it would be really beneficial to you to upgrade
chminx 11:05 I think I'll have to ponder over this a bit longer
just one last thing
can you tell me what this does ?
n = NPN_GetStringIdentifier("coffee"); NPN_SetProperty(<NPP Instance>,<NPNVWindowNPObject obhject> , n, &<myNpObject>);
I know it's sets a propety
taxilian 11:05 yes; it gets a NPIdentifier for "coffee" and stores it in N. It then sets to an instance of your NPObject; in javascript, all global variables are properties of the window object
I guess that would be another way you could get your NPObject accessible to the DOM; I wouldn't do it myself, because regardless of the page it assumes that only one instance of your plugin can exist on a page
chminx 11:05 <light blub>
taxilian 11:05 but it would work
chminx 11:05 so I just need to set another global variabla and give it another NPobject and I'm done
taxilian 11:05 yeah, you could probably do that
NoAntzWk 11:05 I will try to get a slot of time to update.... but I'm in the midst of a development.
chminx 11:05 Thanks, taxilian... I think I'm starting to see the light :)
even though it might not sound like it :)
NoAntzWk 11:05 And.... what about cpu consume in debug mode? it's a know issue?
taxilian 11:05 FireBreathBot: tell masterpinguino you can't put a NSView in the browser in any way that I know of; you can get a CALayer or you can get a CGContext, but those are your options for drawing on the Mac. There is a link on on the mac plugins page (search for mac) that explains the drawing model choices in detail"
FireBreathBot 11:05 taxilian: I'll pass that on when masterpinguino is around.
taxilian 11:05 NoAntzWk: I have no idea what would cause that… however, I'm not going to waste time figuring it out if you're on an old version and it might be fixed
dougma: can you tell me more about FIREBREATH-68?
FireBreathBot 11:05 FIREBREATH-68: Summary: "this" in event callbacks doesn't refer to the dom element
FIREBREATH-68: Assigned To: richard
FIREBREATH-68: Priority: Minor, Status: Open,
NoAntzWk 11:05 I will update. Thank you taxilian!
taxilian 11:05 good luck
rcohn 11:05 Hello - I would like to revisit a question I had asked a couple of months ago regarding configuration and header dependencies. I am building an FB plugin for Windows and I need to have a specific header dependency. While I can modify my ProjectDef.cmake file's include_directories value to add headers, cmake (or perhaps the FB cmake scripts) is enforcing a particular header ordering when the generated Visual Studio SLN file is gen
taxilian 11:05 rcohn: what version are you on?
rcohn 11:05 As a result, my project picks up headers by the same name from the wrong place. To rectify, I am forced to add a VS props file into the project to fix the problem. So, my question is how to automatically add the props file in the cmake scripts - or alternatively, force the header path to be as I need. Thanks very much.
taxilian 11:05 rcohn: what version are you on?
chminx 11:05 @taxilian: thanks, rally greatfull for your time.. have a good day ! :)
rcohn 11:05 Sorry, I was in the middle of the last post when you sent your response. I think I'm using FB 1.4 (where is the version located?).
taxilian 11:05 update to 1.5; there are a few breaking changes, but one of them allows you more control over include_directories
the breaking changes are primarily (maybe entirely, I forget) cmake related
check the version history page
rcohn 11:05 Is there documentation on how the include_directories usage has changed?
taxilian 11:05 yes… on the version history page
under "breaking changes"
rcohn 11:05 Thanks very much. I will check it out.
zeneth 11:05 hi, does anyone know how I would go about creating a mouse scroll event?
taxilian 11:05 zeneth: just for your plugin or did you want to add it to the framework?
zeneth 11:05 I just need it for my plugin, I am not sure I understand firebreath well enough to make a useful contribution
taxilian 11:05 you'd be surprised =]
if you just are worried about one plugin, you can just handle WindowsEvent and check the message it passes through
it's a direct passthrough from the winproc
!findfile PluginWindowWin
FireBreathBot 11:05 Found 2 matching file(s) in the master branch. First 2 are:
taxilian 11:05 take a look
!findfile WindowsEvent
FireBreathBot 11:05 Found 1 matching file(s) in the master branch. First 1 are:
zeneth 11:05 awesome, thanks!
I may need to add support for mac at a later date
taxilian 11:05 That's a bit trickier, but mainly because you might need to support both Carbon and Cocoa
!findfile Mac.*Event
FireBreathBot 11:05 Found 8 matching file(s) in the master branch. First 5 are:
zeneth 11:05 Am I correct in assuming that firebreath does not support mouse drag events yet either?
taxilian 11:05 yep =]
but again, you're welcome to add support
that's where support for things comes from… when someone needs it and takes the time to add it
I havne't needed it, nobody else has added it
zeneth 11:05 If it is still not part of the firebreath by the time I need mac support, I will strongly consider it. =)
taxilian 11:05 hehe. okay
stuartmorgan 11:05 taxilian: FYI, you can leave out the "in any way that I know of" part of your NSView comment if it comes up again ;)
taxilian 11:05 staurtmorgan: fair enough =] I prefer not to make absolutes unless I'm absolutely sure is all =]
stuartmorgan 11:05 (unless this person doesn't care about 64-bit Safari, 64-bit Firfeox, or Chrome)
taxilian 11:05 eh, who uses Chrome, anyway? ;-)
stuartmorgan 11:05 It is absolutely impossible in any out-of-process setup; in process it's possible via ugly hacks
taxilian 11:05 good to know; I'm not a huge fan of ugly hacks, so I'll stick with "not possible"
stuartmorgan 11:05 It's just good to know that it was possible, because people may say "but I saw plugin XYZ do this, you must be wrong!"
taxilian 11:05 true. thanks =]
linearray 12:05 hmm
taxilian 12:05 are you certain?
linearray 12:05 I've got the impression that fb 1.5 is way way WAY more of a burden to xcode 4
with fb 1.4 things worked well more or less, now it eats 5 GB RAM and never finishes building hehe
maybe it's finally time to downgrade to xcode3
kalev 12:05 I bet there are templates involved when it takes so much memory
does xcode 4 use clang instead of gcc?
linearray 12:05 yes
taxilian 12:05 FB 1.5 doesn't use any more templates than 1.4 did
linearray 12:05 trouble starts when it does "indexing" almost forever
taxilian 12:05 there may be a few more boost libs, but not many
you are not the first to have issues with that; seems to be a "feature" of XCode4
I would downgrade, if it were me
linearray 12:05 when you actually build it, it adds a couple of compiler processes with 200 MB each
taxilian 12:05 until they fix it
linearray 12:05 yeah :(
although the xcode4 UI is amazing
FireBreathBot 12:05 JIRA issue issue resolved by richard
JIRA issue issue resolved by richard
JIRA issue issue commented by richard "I have reviewed your pull request and left comments there. To echo them here, we can't change Inv..."
neilg_ 12:05 Mouse drags are broken in Safari
taxilian 12:05 neilg_: is that the one that there is nothing we can do about?
neilg_ 12:05 Yep, that's the one
It's entirely broken in Safari - and that affects even things that aren't plugins. The code to handle it just isn't in WebKit. But patches to fix it were submitted back in '09 (by a Google engineer)
So no wonder it works in Chrome but not in Safari...
taxilian 12:05 lol
taxilian 14:05 !findfile CoreGraphicsDraw
!find CoreGraphicsDraw
FireBreathBot 14:05 Found 2 possible matches. Displaying 2
/^ CoreGraphicsDraw(CGContextRef context, const FB::Rect& bounds, const FB::Rect& clip) $/ (f) found in src/PluginCore/PluginEvents/DrawingEvents.h:
/^ class CoreGraphicsDraw : public RefreshEvent$/ (c) found in src/PluginCore/PluginEvents/DrawingEvents.h:
taxilian 14:05 !find FB::Rect
FireBreathBot 14:05 Could not find any tags matching FB::Rect
taxilian 14:05 !find Rect
FireBreathBot 14:05 Found 1 possible matches. Displaying 1
/^ struct Rect {$/ (s) found in src/ScriptingCore/APITypes.h:
FireBreathBot 15:05 JIRA issue issue created by richard
JIRA issue issue created by richard
JIRA issue issue updated by richard
Commit c6a6dcb on firebreath-1.5 by Richard Bateman: "FIREBREATH-70 Fixed detachobserver to allow recursion"
Commit 0a0c15e on firebreath-1.5 by Richard Bateman: "Mac OS 10.4 support working"
Commit c6a6dcb on master by Richard Bateman: "FIREBREATH-70 Fixed detachobserver to allow recursion"
Commit 0a0c15e on master by Richard Bateman: "Mac OS 10.4 support working"