IRC Log Viewer » #firebreath » 2012-02-14

IRC Nick Time (GMT-7) Message
mkoch_ 07:02 hiho
how can I add a file (a png image oslt) to the plugin (on Mac), so that the gen script will know about it and it will get bundled finally into the plugin binary automatically?
linearray 07:02 try the logs
or the wiki
mkoch_ 08:02 linearray: thanks! the only thing I don't get from the wiki page is that how can I access the filename. so far I had a hardcoded location which is wrong obviously, how can I replace that with the files current location in the bundle?
mkoch_ 08:02 linearray: this retrns nil [NSBundle bundleWithIdentifier:@""]; (where is the ACTIVEX_PROGID)
linearray 08:02 sorry, no idea
I just knew that the info was available somewhere, but I never used it
mkoch_ 08:02 ahh my bad. I've missed the "com." from the beginning :) sry for the nosie
mkoch_ 08:02 next question: can I access the strings in PluginConfig.cmake from the code in runtime?
(without modifying the config.h template, if possible)
taxilian 09:02 mkoch_: you can access those if you put them somewhere useful; config.h gives you the preprocessor defs, you just need to put them in strings somewhere that you can access.
mkoch_ 10:02 taxilian: hi! but for that I need to touch the firebreath's source right?
taxilian 10:02 no, you just need to #include "config/config.h"
and then you can use any of the preprocessor defs in that file
they are just #define statements
so you can use the resulting constants in your code
mkoch_ 10:02 that's from the wiki: FBACTIVEX_PROGID is currently not available as a preprocessor define in firebreath, but you can add it by altering gen_templates/config.h
taxilian 10:02 you can also make your own .h file
mkoch_ 10:02 and that's exactly what I need to access my plugin's bundle (of course it works if I just copy the string from the conf, but it's not the nicest way)
taxilian 10:02 just put it in a templates/ subdirectory and it'll find it's way into the build
mkoch_: you know you can get the path and filename of the plugin, rihgt?
mkoch_ 10:02 well, I'm not sure :) I used pathForResourceOfType with the bundle got from bundleWithIdentifier
taxilian 10:02 well, it's totally up to you, but there is instructions on how to get the path to the plugin binary itself (which is in a fixed place inside the bundle) on the wiki
linearray 10:02 is there a simple reliable way to put a plugin on a page and add an event handler
right now I do: document.getElementById('pluginhere').innerHTML = myplugin; addEvent(plugin(), 'fired', fun);
the first is an async operation, that's why adding the event handler fails
taxilian 10:02 linearray: always use an onload handler before attempting to access the plugin
linearray 10:02 well, this is the onload handler
mkoch_ 10:02 taxilian: is there a way to distinguish between plugin instances? my problem is that I use an external C lib which creates the image I have to display. atm this is stored in a global variable defined with extern "C". as the same memory is used by all the plugin instances, all plugins will display the same content if I have more then one on a page...
taxilian 10:02 and what is the behavior that you want to see?
linearray 10:02 me or mkoch_?
mkoch_ 10:02 taxilian: I'd like to have an array of this images and each instance would use its own image to display
taxilian 10:02 linearray: I mean an onload handler that you pass in as the "onload" param to the plugin; therefore it is called when the plugin is loaded
mkoch_: easiest way8 would probably be to assign an id to each instance and use that
mkoch_ 10:02 yes, that's what I need, but how? with JS?
linearray 10:02 oh that's a good idea, thanks
dinner time
taxilian 10:02 mkoch_ I'd probably use a static int in your plugin class; in the constructor, just save it to the current instance with something like m_instanceId = staticCount++;
then each has its own "instance id"
and you can use that wherever and however you want
mkoch_ 10:02 but I need to define staticCount as global, right?
taxilian 10:02 or static on the class, yes
mkoch_ 10:02 so static public in the class is enough?
taxilian 10:02 doesn't even need to be public, really; you're likely only accessing it inside the class
mkoch_ 11:02 and it's the lack of my C++ knowledge, but how can I set the initial 0 value for the staticCounter?
taxilian 11:02 a static variable has to be declared in the cpp file just like a function
and when you do you can initialize it
mkoch_ 11:02 it works :)
taxilian 11:02 good
mkoch_ 11:02 btw good news, there is a good chance to publish all the work I have done for my company on this wannabe plugin. the higher management likes open source and most probably I will be able to convince them to make this project opensource :)
taxilian 11:02 awesome
FireBreathBot 15:02 JIRA issue issue resolved by richard "This has been fixed"
blarson 15:02 taxilian: Finally found my issue w/ npapi on Chrome+Linux!
I needed to call setvalue(instance, NPPVpluginWindowBool, (void*)false); seems totally wrong - I never get queried if I support xembed
taxilian 16:02 interesting
shenberg 16:02 Say, is the windows installer supposed to install to AppData\Roaming?
I would expect AppData\Local
taxilian 16:02 yes, it is
the theory being that if it is installed to the roaming profile then it will work on other machines that the user logs into
granted, much more recently aquired evidence suggests that by default, windows discards any changes to local activex controls made to a roaming profile (in HKCU) by default, which makes that somewhat less useful
shenberg 16:02 I understand the theory, but my theory is that any place that uses roaming profiles wouldn't want you to spread executable files through the profile - it's an interesting attack vector
taxilian 16:02 it's not an executable file, it's a plugin; also, keep in mind that Chrome by default installs to Roaming
or used to; it's possible that's changed recentlyish
shenberg 16:02 It's at local for me
taxilian 16:02 guess they changed it
shenberg 16:02 (I copied the idea from them back in september 2011, and it was Local then too)
taxilian 16:02 anyway, seems a little odd to install registry keys for a plugin to the roaming profile and not the binary itself, no?
well, it's been probably a couple years since I built that installer
anyway, you're welcome to change it on yours =] and if you want to submit a pull request I'd probably accept it. like I said, it's turned out to not work as well as expected
though I don't see it as a security risk for exploits
or not a significant one, anyway
shenberg 16:02 It's just a vector to spread over a network
taxilian 16:02 which is exactly no more dangerous than anything else that is already there
in fact, it'd be far less work to spread that way than many other methods I could think of
like, for example, adding a .exe somewhere in documents and adding it to the user's autorun profile
shenberg 16:02 Yeah, well, I just got a bit side-tracked - my original question was supposed to be about auto-update methods
taxilian 16:02 lol
there are several methods
most are bad
the others are worse
which would you prefer to discuss?
shenberg 16:02 what would be the "correct" way of doing it? I implemented it the old-fashioned xcopy-deployment way in some program
but that leaves the installed program data broken
taxilian 16:02 there is no "correct" way of doing it. there are several hacks that work to different degrees
however, the common theme on those:
1) always put the plugin in a version-specific directory with a version-specific filename
2) don't try anything crazy like renaming the old plugin file to put the new one in place -- it'll crash the browser in many cases
hmm. those are the big ones, I think
shenberg 16:02 Well, it's a slightly more tactical issue
taxilian 16:02 and here is where we get to the choices between bad and worse
shenberg 16:02 as in, should I do some archive file which I extract and then regsvr32 the new plugin
or execute an MSI in the background
taxilian 16:02 you want my advice? never *EVER* use regsvr32 to install the plugin in production
use a MSI
if you can't use a MSI, do the registry changes using your installer
that way you always know exactly what happened and you can reverse it later
95% of the install issues I've had to deal with (particularly the expensive ones) came from breaking that rule
shenberg 16:02 Roger. So, for now I'll just change the CMAKE scripts to produce versioned filenames and directory names, and try to see how executing the msi from the plugin works
taxilian 16:02 are you supporting IE?
shenberg 16:02 Yes, even though it's somewhat lower on the list of priorities
sandboxing issues?
If I buy a real cert and use it to sign stuff, can I get around that?
taxilian 16:02 as a general rule of thumb that may some day change, there is no such thing as sandboxing in plugins, at least in the way most people think
however, IE when UAC is enabled will run generally in low integrity mode
which is probably the closest thing to sandboxing that you will find
and it will prevent you from starting medium integrity processes (which most apps run as that aren't elevated) which is what you'd need to launch a MSI
search the logs for low integrity mode; the topic has been discussed many many times
so I'm not going to explain it again here
!wiki low integrity
shenberg 16:02 gotcha
FireBreathBot 16:02 1 results found. Note: Results limited to 8
"Deploying and updating your plugin":
taxilian 16:02 hmm. might be something there; someone should really write up stuff on the wiki on it
but just be aware of the issue; you'll need a broker process to launch the MSI
whcih can be a security hazard if you aren't carefyl
linearray 16:02 one amendment: for reasons unbeknowst to me Chrome will mess with your file open dialogs on Mac OS X.
taxilian 16:02 that isn't sandboxing, it's just the result of living inside someone else's process =]
curious, though; the hack we discussed last is still working fine for me. what are you seeing?
linearray 16:02 how is that?
i.e. you cannot filter for file extensions
you will always get the plain file open dialog
taxilian 16:02 really? interesting
linearray 16:02 yeah, try it: e.g. with [oPanel setAllowedFileTypes:[NSArray arrayWithObject:@"txt"]];
it works in every browser but chrome
I was thinking maybe they are doing something cool with a PowerBox or something
but I found nothing of that sort
taxilian 16:02 strange. I don't know enough about it to try to troubleshoot that; almost guarantee it's something to do with you not owning the NSApplication and such, though
FireBreathBot 17:02 JIRA issue issue created by medusade
JIRA issue issue commented by richard "Most often a problem like this is in your code; can you repro the issue using the FBTestPlugin ex..."