User talk:Arantius: Difference between revisions
From GreaseSpot Wiki
Jump to navigationJump to search
m Reverted edits by 94.182.153.8 (Talk) to last revision by Arantius |
|||
Line 1: | Line 1: | ||
== Greasemonkey -> XPI compiler: how to detect when a script is running under it? == | |||
Hello, Arantius. | |||
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 |
Revision as of 10:21, 19 October 2010
Greasemonkey -> XPI compiler: how to detect when a script is running under it?
Hello, Arantius. 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