IRC Log Viewer » #firebreath » 2011-03-09

IRC Nick Time (GMT-7) Message
FB_GitHubBot 00:03 FireBreath: master Richard Bateman * 7d70c63 (1 files in 1 dirs): Fixed problem affecting some mac machines - http://bit.ly/gycsjK
_pq_ 04:03 hello
anyone online knows something about cmake?
saiaman 05:03 hello everyone
:)
nitrogenycs 05:03 hey saiaman
saiaman 06:03 i've got a big one question ..... warning
maybe nothing to do with FB maybe not
my problem is : i want to authorize my use to change it's homepage from plugin..... on firefox
saiaman 06:03 if anyone got any idea ....
nitrogenycs 07:03 you want to change the default homepage of firefox from your plugin
?
jshanab_wcw 07:03 However you would do it in javascript and register a callback then your plugin can call it
oh, wait, you want to change the default setting. humm
nitrogenycs 07:03 Changing it from JS is not always possible it seems: http://forums.asp.net/t/1279376.aspx
due to security constraints
your plugin could alter one of these files: https://developer.mozilla.org/En/A_Brief_Guide_to_Mozilla_Preferences#Modifying_preferences
saiaman 07:03 yeah thanks that's the fact i've managed to change pref.js files
the only proble is the current browser running the plugin
in fact i want to know if i can access the : Components.classes of firefox from plugin ?
nitrogenycs 07:03 ya, I have no idea how to refresh it without restarting the brwoser
saiaman 07:03 yeah this is the problem :(
nomuna 08:03 Hello everyone. I am new to Firebreath. Have created my first plugin for windows platform. It is working with Chrome, Firefox and Internet Explorer. I have a question. How can I detect my plugin in Internet explorer ?
I just found my ActiveX ProgID... I solved my problem. Bye.
stuartmorgan 09:03 taxilian_away: I finally did the overview writeup of Mac plugin models that I've been meaning to do: http://www.escapedthoughts.com/weblog/geek/P110308-mac-npapi-plugins.writeback
You and/or others may find it useful, since it seems to be a common question here
amackera 09:03 stuartmorgan: thank you very much for that!
nitrogenycs 09:03 stuartmorgan: great reading. I'm not into Macs, but I finally start to understand the craziness revolving around the drawing model :)
saiaman 09:03 hi taxilian, how are you ? :)
neilg_ 09:03 stuartmorgan: Thanks for that, that was good to read!
taxilian 09:03 g'morning
stuartmorgan: looks good; I will read it, and we will link to it from the wiki =]
amackera: didn't we figure out that firefox 3.6 and earlier supports cocoa in certain combinations?
stuartmorgan: also, 32-bit binaries using QuickDraw+Carbon seem to work fine on Chrome, even when using OpenGL; not sure why, since it seems like this shouldn't work
stuartmorgan 09:03 taxilian: "fine" is a relative term
taxilian: the performance is abysmal
taxilian 09:03 true =] let me say then that "it seems to work"
stuartmorgan 09:03 Substantially worse than doing a buffer readback using CG
taxilian 09:03 hmm. we have had performance issues so far, but haven't dug into it that far; and, of course, now that we support CoreAnimation for newer browsers we probably won't =]
interesting
stuartmorgan 09:03 It works because Chrome gives the plugin a real, offscreen window, and then uses really slow windowserver SPI to scrape the window
taxilian 09:03 ahh; that would be why we're not having that issue
we didn't actually draw with quickdraw, we created an AGL context and drew wtih that
stuartmorgan 09:03 Right, that's what most QD plugins do
Thus the really hacking approach
*hacky
taxilian 09:03 this is a great article; I could wish you'd put it on colonelpanic ;-)
stuartmorgan 09:03 But since the only reason to use QD is because you want speed, using QD in Chrome is always counterproductive
Nils0r 09:03 taxilian!
taxilian 09:03 howdy
Nils0r 09:03 hi
taxilian 09:03 stuartmorgan: good to know
stuartmorgan 09:03 Try a Unity demo on 10.5 in Chrome if you want to see why it's a bad idea ;)
Nils0r 09:03 okay my question
im having plugins running on the npruntime samples from mozilla
how to i get the params from the object tag
there's one called "data"
taxilian 09:03 you're doing your own NPAPI plugin?
Nils0r 09:03 <object ... data="...">
taxilian 09:03 not using FireBreath?
Nils0r 09:03 no
But i know you got fair knowledge in that area
taxilian 09:03 just verifying I know what question to answer
you already know that I think you should write it with FireBreath so you don't have to worry about all of this yourself, so I'll skip to the answer ;-)
Nils0r 09:03 Yes i know
taxilian 09:03 actually, let me verify something
one sec
so there are two things
what you're talking about is actually an attribute of the object tag
not a param
though on NPAPI it may actually give it to you the same way, I forget
Nils0r 09:03 ah yeah well
i'd like to know about both actually
taxilian 09:03 a param will actually go in a <param name="…" value="…" /> tag
inside the object tag
Nils0r 09:03 the information can be either set in the data attribute or in the params
yep
the specification allows both
taxilian 09:03 take a look at https://github.com/firebreath/FireBreath/blob/master/src/NpapiCore/NpapiPluginModule_NPP.cpp#L144
then look at https://github.com/firebreath/FireBreath/blob/master/src/NpapiCore/NpapiPlugin.cpp#L73
argc is the number of params found
argn is an array of the names / keys
argv is an array of the values
if that gives you everythign you need you're done; FireBreath uses a different technique to get the attributes because on IE we don't get the attributes with the <params>
Nils0r 09:03 Aye
So its actually NPP_New where i should start with
taxilian 09:03 ues
yes
stuartmorgan 09:03 taxilian: (re Cocoa event model in Firefox 3.6, I guarantee it doesn't work. The code literally doesn't exist in Gecko 1.9.2, even as something experimental)
taxilian 09:03 huh. must be my memory playing tricks on me
Nils0r 09:03 Thanks already taxilian
taxilian 09:03 yw
stuartmorgan: don't suppose I could convince you to add a link to FireBreath somewhere in that article, could I? ;-)
stuartmorgan 10:03 taxilian: You're welcome to leave a comment
taxilian 10:03 =] I will do so, then
stuartmorgan 10:03 taxilian: You might want to fix Mac plugins first though...
taxilian 10:03 hehe. amackera says he's working on that ;-) I'll spend a little time on it Saturday as well
jshanab_wcw 11:03 I am stuck on a weird bug. If I use my plugin in a simple html page, it works. If I use it in the jquery page we been working on it hangs the browser. If i start ie with extensions disabled, it displays the jquery fine. If i step trhough it it gets part way thru the start up then goes off into mshtml.dll and never returns. Works on FF only
I am desperatly seeking any ideas!
taxilian 11:03 jshanab_wcw: are you manipulating the plugin in any way with jquery?
FB_GitHubBot 12:03 FireBreath: master Richard Bateman * 378c390 (2 files in 2 dirs): fixed issue #166 - unicode chars in an URL don't work - http://bit.ly/h3zFdG
FireBreath: firebreath-1.4 Richard Bateman * e8dd4cd (2 files in 2 dirs): fixed issue #166 - unicode chars in an URL don't work - http://bit.ly/e8Qyb0
jshanab_wcw 12:03 taxilian. Yes I am . It eork until recently when more UI elemets were added (in process of commenting them out now)
taxilian 12:03 you could also add log messages to the various APIs and see if something is getting called that you don't realize
jshanab_wcw 12:03 If you mean javascript API, I put a breakpoint on each, it never gets that far. It does create the jsapi object, but hangs before I click on a control
taxilian 12:03 how are you creating the object tag?
jshanab_wcw 13:03 i have in a simple html test page. <object type="application/x-mvsarchiveplayer" width="720" ....
taxilian 13:03 hmm. okay
weird
let me know when you figure it out
jshanab_wcw 13:03 but it gets "wrapped up" in an outer div that handles the jquery control
taxilian 13:03 I'll be curious
jshanab_wcw 13:03 ok, here is a really weird one, the plugin works in a simple page without the jquery wrapper div. (twilight zone music)
taxilian 13:03 jquery may go through and do something to the child elements
jshanab_wcw 13:03 I wonder if it is somehow that double init thing again, one iniot withour the params.
taxilian 13:03 which browser?
jshanab_wcw 13:03 works in FF only hangs in all other browsers, never loads page. but in chrome i let it run for a long time and it came back!
taxilian 13:03 the only reason you'd get it initializing with no params is if you're moving it around in the DOM or if you're on IE and creating it with ActiveXObject
jshanab_wcw 13:03 ok
"moving it around in the DOM" ? what exactly would that be, maybe JQuery is doing this. What is the best point in the program to see if that is happening
taxilian 13:03 removing it from one place, adding it somewhere else
doing that with the div or another parent would also qualify
jshanab_wcw 13:03 humm. I wonder....JQuery uses css to wrap html in a div that it then it changes the classes, so it's position in the dom does change
taxilian 13:03 hmm. yeah, that could do it
neilg_ 13:03 its
taxilian 13:03 also some css changes will do it
neilg_ 13:03 </grammar nazi> ;)
jshanab_wcw 13:03 Oh, lots of those. Ok, I need to test this theory and make it more risilient to this
Is this the constructor called twice? or is it the static init, I want to debug it. I put break points on all the ctor and the static init and I get thru one round of static init->plugin CTOR->createJSAPI->apiCTOR->pluginready and then to on window attach and I loose it
taxilian 13:03 doesn't look like the contrctor is being called twice
jshanab_wcw 13:03 Right. looks good. Evertime i step thru I get into the ATL stuff then it goes down into mshtml.dll and is still running, but not stopping
The last FB call I saw was case OLEVERB_INPLACEACTIVATE in atlctl.h
taxilian 13:03 that sounds right
EL45 13:03 Would anyone have time to show me an example of how to use FB::SimpleStreamHelper::AsyncGet to fetch a text file?
taxilian 13:03 EL45: there is an example in FBTestPlugin
EL45 13:03 Ok. Thank you. I will check that out.
jshanab_wcw 15:03 taxilian PluginMain->SetWindow(PluginWin) in FBControl.h line 339. i am finding PluginMain is a null pointer in some tests
taxilian 15:03 jshanab_wcw: on IE?
jshanab_wcw 15:03 yes
taxilian 15:03 something is moving the plugin around in the DOM, then
that's on my list of things to fix, but it's very non-simple
jshanab_wcw 15:03 My co-worker is trying to narrow it down. I could not get to an error dialog, he reduced and reduced our jquery until he got this message and it co-incides to where I was going off into neverland
taxilian 15:03 like I said; something is moving it around in the dom
or perhaps doing something with CSS that hides it
something that is causing InPlaceDeactivate to get called
which shuts down the plugin
what I need to do is make it so we can partially shut down the plugin on InPlaceDeactivate, but then recover from that if InPlaceActivate is called again
that will be tricky, to say the least
jshanab_wcw 15:03 So for some reason FF handles this. That suggests a fix.... gimme 5
taxilian 15:03 it's completely different code
FF does things completely differently
they are only similar when you sit from the perspective looking at it 5 abstractions away
or so
jshanab_wcw 15:03 Ok. Confirmed. It is the wrapping in a div that the plugin did that caused the problem. While it does not work properly, it draws the control and continues
but... now it immediatly crashes FF. I can't win
taxilian 15:03 where is the crash?
jshanab_wcw 15:03 throws on getPlugin() cause plugin is now null
But when i change the wrapped div, I dropped the level by one. so... maybe gotta adjust some jquery stuff
taxilian 15:03 on firefox?
plugin should never be null on firefox
jshanab_wcw 15:03 Well...We took out a div level. Removing the "parent" and the "children" references in the jquery stops the crash and now it looks equally bad on both but neither crash. I hope the info helps, what it means for now is we rework the JQuery to insure the DOM remains :-)
taxilian 15:03 lol
what do you need to do with it?
nitrogenycs 15:03 taxilian: I've talked to the swig guy
taxilian: He will upload his v8 prototype to github during the weekend probably
taxilian: swig v8 prototype I mean
taxilian: reportedly, simple C++ stuff etc is already working
taxilian: so this leaves the firebreath side. I guess what I have to do is create a new V8Core/Host library
taxilian 15:03 nitrogenycs: the first thing to do is to get a firebreath project up somewhere that links with and starts up V9
v8
nitrogenycs 15:03 yes
taxilian 15:03 once you have that going I can look at it with you and we can figure out where to go from there
I don't think it'll be hard, to be honest
nitrogenycs 15:03 okay
taxilian 15:03 but I need to see how its APIs work
nitrogenycs 15:03 I also doubt it will be that hard
how do you want to integrate this with firebreath?
taxilian 15:03 I mean, we're tying an API designed to work with Javascript into a new API
nitrogenycs 15:03 yes
taxilian 15:03 the best way would probably be as a FireBreath Library in a seperate respository
take a look at src/libs/*
nitrogenycs 15:03 yes, that's what I was thinking
taxilian 15:03 jsoncpp, log4cplus, and HttpService are good examples
so you basically just put the v8 library in the right place and do add_firebreath_library
nitrogenycs 15:03 what do I have to do to cmake to make that working? anything more than the cmakelists.txt?
taxilian 15:03 then we have some relatively simple initialization stuff you put in your project
no
it's pretty easy
nitrogenycs 15:03 okay
taxilian 15:03 it just has to tell firebreath about the link libraries and include directories
nitrogenycs 15:03 is it best to create a branch from master for this?
taxilian 15:03 that's about it
I woudln't put it in FireBreath itself, actually
nitrogenycs 15:03 ok, you would somehow pull it in as an extenral dependency?
taxilian 15:03 right
nitrogenycs 15:03 okay. So I could pull in chrome as an external dependency into my library too if I wanted to
taxilian 15:03 we could even tie something into the firebreath project to make it easy to find "supported" firebreath libraries and make a tool for grabbing them
the setup is pretty primitive still, but we can expand it as we create libraries and find new requirements
nitrogenycs 15:03 I guess you prefer github for hosting this stuff?
taxilian 15:03 git is definitely the easiest
nitrogenycs 15:03 yes, I also like it best
taxilian 15:03 I've used svn, bzr, mercurial.. I will never go back if I have a choice
github seems like a pretty good host for open source git projects
so yeah, github works well
gotta go to class now. be back on in 20 min or so
nitrogenycs 15:03 okay, I'll talk to you tomorrow then
taxilian 16:03 back
sabotaged|wk 16:03 knowing not that much about win32 graphics: should it be possible to create a child window with CreateWindow inside the plugin's window?
taxilian 16:03 yes
many have done so
sabotaged|wk 16:03 ok
taxilian 16:03 in fact, that's what you have to do if you were to use a multi-process plugin
because you can't steal the winproc across processes
sabotaged|wk 16:03 hear any more discussion about mac IPC video to the plugin window?
i know there was some a while ago on the mailing list
taxilian 16:03 not that I'm aware of
it's always possible to do some sort of IPC, but it's not going to be ideal
stuartmorgan 17:03 sabotaged|wk: what do you want to know about Mac IPC?
sabotaged|wk 17:03 on windows you can cross process draw to a native window: on mac it seems you can't. i want to implement the next easier thing
easiest*
sending video frames via cocoa distributed messages or something i guess is possible, but kind of a PITA
stuartmorgan 17:03 easiest, or performant?
sabotaged|wk 17:03 depends i guess, on what tradeoffs i would have to maek
stuartmorgan 17:03 easiest is probably to create a block of shared memory and use some kind of locking/signaling to prevent simultaneous read/write
performant is to use IOSurface (10.6+)
sabotaged|wk 17:03 is IOSurface a public api?
stuartmorgan 17:03 Yes
There's not much documentation, but it's public, and there are examples out there of code that use it
sabotaged|wk 17:03 any ideas on an IPC mechanism for signaling with the shared memory approach?
stuartmorgan 17:03 Depends on how the rest of you IPC works, whether one process or the other is in charge of the schedule, etc
sabotaged|wk 17:03 i'm using distributed notifications for easy signaling between my plugin and an external process right now. not sure if that would hold up for a bombardment of video frame sync messages though
stuartmorgan 17:03 sabotaged|wk: the main issue isn't going to be the technology, it's going to be the design for how you want the synchronization to behave
Which side decides when drawing happens, what to do if one side is too slow, etc
sabotaged|wk 17:03 sounds like fun
know of any open source implementations of this or anything like that? just to look to see how they do it
amackera 20:03 taxilian: I'm taking a look at the mac model negotiation now
taxilian 20:03 amackera: yay!
let me know if you need help
we can chat, we can skype, we can call
we need this done =] :-P
amackera 20:03 indeed :P
amackera 20:03 this refactor really is not bad at all
it's very clean code
taxilian 20:03 of course it is
amackera 20:03 haha
taxilian 20:03 this guy was my mentor in C++
there are just a few things that need to be finished
amackera 21:03 The model negotiation is fine
one small addition to enable CG in Cocoa
the window classes will need a little work to work with CG+Cocoa
taxilian 21:03 yeah
it didn't look bad
the main thing is to add the draw event
so that it works the same regardless of which event model is used
not sure why stuart was so up in arms over it; it's not perfect, but it's not that bad either
amackera 21:03 We should pass the drawing primitive in the draw event, and then clearly say in the FB docs that it's guaranteed just for the event's duration
FB_GitHubBot 21:03 FireBreath: master Anson MacKeracher * 3f05bbf (1 files in 1 dirs): Added Cocoa + CoreGraphics model negotiation. - http://bit.ly/ePHopQ
taxilian 21:03 agreed
amackera 21:03 alright, I understand this code much better now
It's getting late here so I'll have to push the window class fixes until tomorrow
taxilian 21:03 ok
amackera 21:03 good night!
taxilian 21:03 g'night
Demetrius 22:03 Richard Here?
kylehuff 23:03 Demetrius: richard is away for the night