IRC Log Viewer » #firebreath » 2011-02-15

IRC Nick Time (GMT-7) Message
taxilian 00:02 methods and properties of that JSAPI object can themselves return instances of JSAPI objects, allowing you to have a multi-level hiererchal interface
let me know when you've digested that and I'll give you some more =]
mital 00:02 what is the difference between JSAPI and JSAPIAuto
taxilian 00:02 one more quick explanation: FB::variant is the core datatype for interacting with javascript. everything coming from the browser or going to it is stored in a FB::variant. JSAPIAuto is "Auto" because it automatically converts the variant type -- no matter what is stored in it, be it int, string, bool, object, etc -- to the type that you specify
lol. well, that's the core of it
JSAPI is the root interface
JSAPIAuto is the implementation aid
for example, there is also a JSObject which represents an object from the browser
it extends JSAPI, not JSAPIAuto
because it's not a C++ defined API; it's something from the browser
so it implements the needed methods that JSAPI requires, but needs no help from JSAPIAuto for the implementation
and in fact behind the scenes it is a different object which extends JSObject -- depending on which browser you're on
so when you registerMethod to register a method that takes two int params and returns a double, the reason you can do that is that JSAPIAuto provides you with tools to do it
so in practice, you almost always extend JSAPIAuto -- but if you wanted to do something really fundamental and low level, you could just extend JSAPI
it would just be more work
mital 00:02 all these JSAPI objects are in ScriptingCore right?
taxilian 00:02 the root objects, yes
as is FB::variant
mital 00:02 Plugincore is using scriptingcore and getting jsapi root
taxilian 00:02 yes
mital 00:02 no actually it takes it from derived plugincore... which gives a derived class of jsapiauto
taxilian 00:02 oh, yes, sorry, misunderstood
when you extend PluginCore one of the things you're required to do is implement that function
mital 00:02 all the base classes are in scriptingcore... whats there in npapicore ?
taxilian 00:02 it doesno't have to be something derived from JSAPIAuto -- it just usually is
has to be something derived from JSAPI
which JSAPIAuto is
mital 00:02 ok
taxilian 00:02 NpapiCore and ActiveXCore have the adapter layers in them
first, though, you still need to know what BrowserHost is
mital 00:02 so jsobject is wrapper over native javascriptobjects used by our classes
taxilian 00:02 right
which is kinda funny, really
because when you pass a JSAPI object to the browser, it gets wrapped in a browser-specific adapter to make it work
then when the browser gives us an object, we wrap that object in a JSAPI adapter to make it work
theoretically you could keep doing this as many layers as you wanted :-P
but we try to avoid that
so the BrowserHost instance gives you access to whatever browser APIs are available
it is an interface
well, a virtual base class anyway
http://www.firebreath.org/display/documentation/class+FB+BrowserHost
you can see the inheritance graph
there are two different types of BrowserHost object -- one for each browser API we support
the main use for the BrowserHost object to us is to be able to make calls on the main thread -- since you can only talk to the DOM on the main thread -- and to access the DOM
you can also create streams using the browserhost, though, which can also be useful (download stuff)
however, if you dig into ActiveXBrowserHost or NpapiBrowserHost you'll find that they do a lot more than that, just only in their respective layers
(waiting for you to digest =] sorry, when you ask for an information dump you get dumped on :-P)
mital 00:02 I think I would be happy to explore the jsapi, jsobject, plugincore ... I will not go to activex or npapi layer for now
taxilian 00:02 okay; those are the objects that you need to understand to write firebreath plugins
at least, to write them well
mital 00:02 :D yeah I can feel that... but its too much for me... actually I am looking at code side by side ... thats taking time
taxilian 00:02 so it's good to understand how they work =]
they really aren't that complicated, however
feel free to ask questions
mital 00:02 yeah sure... thanks for this info :)
taxilian 00:02 hope it helps
I hope also that when you get to the point that you feel like you understand it you will write it up to help the next person before you forget what it was that finally made it clear =] it is hard for me to explain to someone unfamiliar with the system because I am too deeply involved in it
mital 00:02 yeah I will create a wiki page on confluence
taxilian 00:02 cool =]
mital 00:02 http://www.firebreath.org/display/documentation/How+FireBreath+Works+-+code+perspective
taxilian 00:02 if you feel it would be more appropriate as a blog post we could put it on colonelpanic as well / instead
mital 00:02 though there is no content yet.. i am planning to put some
taxilian 00:02 just as a thought
okay
mital 00:02 I would write a blogpost as well
taxilian 00:02 and feel free to take notes and leave them on the page; it doesn't have to be polished to be useful
mital 00:02 ok
what is the entry point of the program
the dllmain where the object gets injected
taxilian 00:02 heh. I thought you didn't want to dig into npapi or activex yet? =]
mital 00:02 oh its in npapi
np
taxilian 00:02 well, or it could be in activex
it depends on your browser
mital 00:02 i will look at those places later
also OS right
taxilian 00:02 yes, though to a lesser degree
all NPAPI entrypoints work about the same way; just some of the initial details differ
activex is very different
mital 00:02 ok
taxilian 00:02 to the plugin developer, the entrypoints are in the Factory; I should have actually mentioned that earlier
that's another piece you'll want to know
FactoryBase
in PluginCore
the project, not the class =]
mital 00:02 hmm ko
ok
taxilian 00:02 http://www.firebreath.org/display/documentation/class+FB+FactoryBase
you have a working FB plugin, right?
mital 00:02 yeah
taxilian 00:02 if you look at your project, you'll see that you have a Factory.cpp
mital 00:02 I have my example plugin working on windows and mac
taxilian 00:02 that contains the "entrypoints" for your plugin
mital 00:02 yeah... btw why this creates myPlugin project as well as MYP_PluginAuto project ?
taxilian 00:02 hehe. another very good question
so MYP is the prefix of your plugin
defined in PluginConfig.cmake
basically it is a sortof-dynamic project
that is a project that is firebreath code, rather than yours, but it knows about your plugin
it knows about everything in PluginConfig.cmake
so it can use constants, configuration options, etc
and conditionally compile things as needed
it controls logging, what PluginWindow objects are supported (particularly on Mac), and makes sure that the activex controls are created with the correct mimetypes and GUIDs
so even though the code is static, the includes that it relies on are specific to your plugin -- thus there is one per plugin project of yours
this is the main reason that FireBreath can't just be packaged as a library and used
mital 00:02 it needs to know about my plugin ... what is the exact things u need to know about my plugin ?
taxilian 00:02 everything in PluginConfig.cmake
depending on whether or not you disable the GUI it will compile a bit differently; depending on which mac drawing and event models you select
for IE it has to generate a file which instantiates the activex control template for each mimetype and guid
on linux there are functions that return the mimetype(s)
basically everything in src/PluginAuto needs to know something about your plugin -- otherwise it wouldn't be in that project
mital 00:02 hmm ok I will take a look at the source
thanks :)
taxilian 00:02 =]
happy to help, particularly since you're so willing to reciprocate
taxilian 01:02 well, I'm off to bed
good luck
saiaman 02:02 hello eveyone
saiaman 02:02 i've got a little question : does anybody tried wix installer ?
iaincollins 03:02 saiaman: Hi again, yeah I can help you with that maybe
saiaman 03:02 hmm ok
maybe the problem is anywhere else
but in fact my plugin reads an entry in the registry
and it seems that it can't read on another computer and the install was with the wix installer
iaincollins 03:02 sorry, I had to go AFK...
is the problem that the plug-in working but can't read something you want it to the registry, or is it not appearing to be setup in the registry by the installer?
saiaman 06:02 hello
juste another question : is there file access restrictions while in plugin?.
nitrogenycs 06:02 there's low integrity mode in internet explorer
other than that, no
of course you still don't run as administrator, so you can't modify windows system or c:\program files etc
but I think you can make your plugin run under any rights you want. except you'll get a prompt if you'd want to run as administrator
saiaman 06:02 the fact is that i'm tryin to check existence of a file in c:\program files\****
nitrogenycs 06:02 I think you have read access to anything
even in low integrity mode
but not write access
saiaman 06:02 ok perfect
read acces so i can stat a file :)
nitrogenycs 06:02 you can test for yourself: http://msdn.microsoft.com/en-us/library/bb625960.aspx
saiaman 06:02 thanks so much
nitrogenycs 06:02 it's quite easy
just put a cmd.exe in low integrity mode
and you'll see what it can do
saiaman 06:02 yeah thanks so much
you rocks :p
nitrogenycs 06:02 :) np
iaincollins 06:02 nitrogenycs: hey that's cool, didn't know you could set low integrity like that
saiaman: you *might* need to have a signed dll and/or some registry settings set on some platforms (and/or depending on users browser settings in IE if they have been messing with them) but I've found most stuff seems to work fine cross browser
Chrome MIGHT be special at some things
I THINK you have to opt-in to use the Chrome sandbox stuff, but I am not sure
saiaman 06:02 hmmm ok
thanks for info
saiaman 06:02 waow i've got an hyper-space bug
first time i check file existence, i found it
and second time it doesn't exist anymore
:(
any ideas ? :)
iaincollins 07:02 :/ nope
neilg_ 07:02 How did you check for file existence?
saiaman 08:02 please anyone, does anybody knows how to manage plugin updates ?
iaincollins 08:02 the easiest way to do this is probably to have a "version" or "buildnumber" property in your plug-in
saiaman 08:02 hmmm ok .... and now i've got some....difficulties with low rights... the wix template does not include low rights regs right ?
iaincollins 08:02 hmm what do you mean?
note: when you do update your plugin you will need to incriment the CSLID for IE to update the plugin without a browser restart, and then delete the "build" directory (running the prep script again to recreate it)
saiaman 08:02 the fact is that, as google with their Google Update plugin, i need to download an executable file and launch it
iaincollins 08:02 *I mean generate a new GUID CLSID
Yes, you need to do that. On IE you can also distribute it via a CAB file, on Firefox you can use their plug-in install API with a manifest
For Internet Explorer and Firefox users on Windows, I wrote a ClickOnce app to wrap the installation process
If you have quicktime installed there is a little video of what that looks like here
http://downloads.talktalk-labs.com/plugin-install-video/
(I have wrapped the install of the msi)
(I tried converting that video to raw MPEG4 / uploading to youtube but it keeps getting corrupted)
the first time you run that an approval dialog comes up (not shown) confirming the name of the owner of the digital signature of the ClickOnce app, but it's very user friendly
getting the upgrade process was the most time consuming thing for me by far, but the WiX installer really made it easier
taxilian 08:02 iaincollins: You dont have to update the clsid on ie to get updates without restart
iaincollins 08:02 oh really? hmm I wasn't able to do that with the plugin previously loaded
could the problem have been me not unloading it?
taxilian 08:02 I dont knoe
But i have been doing it for years
iaincollins 08:02 hmm I will investigate, I only had the problem in MSIE (and that was after changing install dir)
hmm
I will look again at that
taxilian 08:02 I install the new one as a new filename and register it
iaincollins 08:02 yeah same (and different install dir, following your tip)
saiaman 08:02 hmm taxilian seems good way right
taxilian 08:02 I also detect using new ActiveXObject
But object tag works too
iaincollins 08:02 Oh! Right yeah I had a problem getting that to work
(the ActiveXObject check)
taxilian 08:02 Yeah, I fixed it
Gotta run. Be back later
saiaman 08:02 ok CU taxilian
iaincollins 08:02 kk, cool & ty for that info, will give upgrades a look over again with 1.4
saiaman 08:02 only one question now we've seen that update problems
juste imagine, my plugin is a downloader / launcher for executable files
taxilian 08:02 saiaman: If you want to download the update with your old plugin
saiaman 08:02 but i allways have UAC small window poped up
yeah taxilian
taxilian 08:02 Youll have to have a process to launch it
That can be elevated
To medium integrity
saiaman 08:02 ah ok
taxilian 08:02 Because launching it from the plugin would be low integrity
saiaman 08:02 so i need to install my plugin as elevated ?
or ??
taxilian 08:02 Not uac elevated if you dont need admin
But medium integrity
saiaman 08:02 ok, i'll read how to do this with wix so ...
but if anyone has samples i take this :)
taxilian 08:02 Not a wix thing
iaincollins 08:02 http://www.firebreath.org/display/documentation/Deploying+and+updating+your+plugin might be good :)
taxilian 08:02 Search the logs
Bye
saiaman 08:02 ok thanks taxilian
bye
iaincollins 08:02 we add registry keys to elevate the permissions in IE (but for security reasons, only for our site, as our plugin is site specific anyway by design)
saiaman 08:02 hmmm ok
but under mozilla i have UAC pop up
under win 7
saiaman 09:02 iaincollins : do you have changed your wxs in order to add more registryvalues for ElevationPolicy ?
swingburner 09:02 good afternoon... i spoke to you yesterday regarding possibility of using firebreath to produce plugin for printing labels... We have worked on embedding PDF and this is successful, however, we have an issue that reporting services automatically sets the orientation based on width/height which is wrong and there is no way to force the orientation. It looks like we need to write this plugin with FB to use theHTML that report
taxilian 09:02 Orientation is set in the PDF
So you might just need a different PDF lib
jshanab_wcw 09:02 Good morning :-). I have an issue that started last night where my test page dragged into IE causes an immediate "runtime error". This happened some time after 1.2-->1.4 upgrade, but I think I may of runit ok after the upgrade. It is the error where it calls both setClientSite nad it calls SetSite in FBControl and therefore calls setReady() twice which crashes. Looking for clues, ideas
taxilian 09:02 jshanab_wcw: Did you figure out if it's the same instance?
iaincollins 09:02 saiaman: sorry, yes I did
swingburner: Yeah, what taxilian said, I really don't think in your case a plug-in is needed. I don't think you are getting good advice RE: print CSS or PDFs, sorry :/
not that I wouldn't want to you put off doing a plug-in, but it's way easier just to generate a PDF or some CSS to do that and if someone can't do that then the chances of them maintaining and working with plug-in to handle it a probably pretty slim :/ (IMO)
saiaman 10:02 i meen this : iaincollins do you have to lines needed in the wxs for that
iaincollins 10:02 if you are having problems with orientation (and can't resolve it by using another PDF conversion lib) at very worst you could just use markup/CSS to rotate all text and labels (which every HTML rendering engine supports)
saiaman: Oh, that URL I posted has them
(both URL's actually I think)
saiaman 10:02 yeah but i've been disconnected
( some problems with my network actually )
jshanab_wcw 10:02 Well the this pointer is different, so it seems like two instances
iaincollins 10:02 saiaman: http://www.firebreath.org/display/documentation/Deploying+and+updating+your+plugin (also trying searching Wiki for WiX - can use IRC log search if that happens again too)
saiaman 10:02 hmm ok thanks
but in fact i've tried allready this
but when my plugin launches the exe.... still have same uac
:(
what is "MyBroker.exe" in the configuration shown ?
taxilian 10:02 jshanab_wcw: then you have something in your page that is a problem
are you changing the css of the object tag in js?
saiaman: you can't launch your installer directly from your plugin because your plugin is in low integrity
saiaman 10:02 hmm ok ....
thanks
taxilian 10:02 you need to package an additional exe -- like MyBroker.exe -- and when you install it add the elevationpolicy key so that MyBroker.exe starts in medium integrity mode
then have mybroker.exe lanch the update
'ware security issues
saiaman 10:02 ok
and can my plugin start mybrocker ?
as GoogleUpdate plugin ?
neilg_ 10:02 Yes
Yes it can
saiaman 10:02 so i can use mybrocker as a "proxy" for launching my updates right ?
neilg_ 10:02 Right
saiaman 10:02 waouw cool
thanks so much
neilg_ 10:02 All you need is to have your installer create a registry key so that IE knows that it can run your process with medium integrity (which means regular user rights)
saiaman 10:02 got to find how now :) :) but google is my best friend
ah ok
taxilian 10:02 like I said... be careful. make sure it can't be used to launch an arbitrary process
that would be a Bad Thing(tm)
saiaman 10:02 i understant taxilian
neilg_ 10:02 http://msdn.microsoft.com/en-us/library/bb250462(v=vs.85).aspx has everything you need to know
saiaman 10:02 in fact i need to build a GoogleUpdate like plugin
thanks neilg :) :)
With googleupdate plugin, you can install for example chrome without any uac or everything
and you know, i'm a little noob and i'm trying to find out
neilg_ 10:02 Right, I believe it installs to your user directory rather than Program Files in order to do that
saiaman 10:02 yeah right
and they install a GoogleUpdate.exe just like the brocker we talked before
taxilian 10:02 you could just use GoogleUpdate... it's open source
saiaman 10:02 yeah you're right :(
jshanab_wcw 10:02 taxilian. sorry for the slow responsees, busy morning. Here is my testpage that has worked with IE fine for a long time. http://pastebin.com/gQDA1HAn
Is there anything I am doing that can cause such a double init?
taxilian 10:02 jshanab_wcw: yep
line 111
when you do that it creates an instance of the plugin
which is exactly what I ask if you were doing
using ActiveXObject
when SetSite is called it's because you created it with ActiveXObject
and it doesn't have any params
so you just need to handle that gracefully; if it is created with SetSite then you aren't in the dom
jshanab_wcw 10:02 Oh, wow, wonder why it took so long to bark at me. Is there a better way of checking to see if the control exists to trigger my download.
I think i know why it let me get away with it before. In 1.2 I specified the params, in 1.4 I removed that code
taxilian 10:02 shouldn't matter
it probably never called onReady in 1.2
jshanab_wcw 11:02 A question about multiple objects on the same page using my plugin. If there are 2 with my mimetype, how many plug in instances are there? How many javascriptAPI instances? If I have a plugin playing video back, does my plugin have to handle multiple clients or is it simpler than that?
taxilian 11:02 once plugin instance per object tag
jsapi instance depends on you
hypothetically you could share the same jsapi instance between all instances
though I wouldn't recommend it
jshanab_wcw 11:02 OK, very very good. So I could, for example load in different dll's into the plugin depending on say the camera type.
taxilian 11:02 from a plugin perspective there is no difference between creating multiple instances on the same page and creating multiple instances on multiple pages
each is a plugin instance
jshanab_wcw 11:02 The default provides a {plugin}API.cpp for each, I just have to name them each different in the javascript side of the world
taxilian 11:02 right
well, doesno't matter how you name them on javascript side
each is connected to its own object tag
you just have to keep track of which is which I suppose
just like anything else in js
jshanab_wcw 11:02 Plugin crazy here. JQuery has just the ticket, "jquery plugins"
So it should be possible for my plugin to contain a few sub-dll's and load the specific one i need based on a param.
taxilian 11:02 sure
jshanab_wcw 11:02 Excellent. This is coming together nicely
taxilian 11:02 well of courseā€¦ it's FireBreath
jshanab_wcw 12:02 :-)
sabotaged|wk 12:02 on github commits when you say for example "fixed issue #144", how do i find where issue 144 is
taxilian 12:02 go to firebreath.org and click "issues"
it's still on google code for now
one of these days I'll set up jira
sabotaged|wk 12:02 oh i see its on google code
taxilian 12:02 yep
sabotaged|wk 12:02 hey when you mentioned about upgrading on mac yesterday, and just changing the filename
taxilian 12:02 yeah
sabotaged|wk 12:02 does that work for safari+chrome+firefox?
sweet
taxilian 12:02 yes
well, not 100% certain about chrome
but I think so
sabotaged|wk 12:02 ok
jshanab_wcw 13:02 BTW, i noticed if I log a number, like so "FBLOG_INFO("CArchiveFilter_V2", "nal type = " << type );" I get the hex value 01 in the log and not the character "1". Do I need some special formatter?
taxilian 14:02 hmm
I don't know
it uses the std::stringstream
so presumably the same rules apply