User talk:Arantius: Difference between revisions

From GreaseSpot Wiki
Jump to navigationJump to search
No edit summary
m (Protected "User talk:Arantius" ([edit=sysop] (indefinite) [move=sysop] (indefinite)))
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== Greasemonkey -> XPI compiler: how to detect when a script is running under it? ==
Please do not use this wiki as a communication channel.
 
I'm on both of the mailing lists (see [[Greasemonkey Manual:Getting Help|getting help]]), as well as the rest of an entire community that can help you out.
Hello, Arantius.
If I can answer your question, I'll do it there.
I am using your compiler to port one of my userscripts into a firefox extension. The script has got some features that are useful while it's still a script (e.g.: checking for new versions), but completely useless - or, worse, even dangerous - if running as a FF extension.
Is there a way to detect whether the script is running thanks to the script-compiler.js or not? I was thinking about a variable, maybe something simple like MOUNTED = True on loading of the script and False on unloading, but how to achieve that? Or do you have any better suggestion?
Thanks a lot, and keep on doing your great job :)
Daniele
: There isn't a good way now.  The easiest would be to test for the presence of an API newer than the compiler, e.g. [[GM_listValues]].  If that function exists, it's not the compiler, because the compiler doesn't provide it. [[User:Arantius|Arantius]] 22:00, 19 October 2010 (UTC)

Latest revision as of 13:20, 29 October 2010

Please do not use this wiki as a communication channel. I'm on both of the mailing lists (see getting help), as well as the rest of an entire community that can help you out. If I can answer your question, I'll do it there.