Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Javascript running "under XUL" and add-on owner

59 views
Skip to first unread message

Yves Dolce

unread,
Aug 21, 2012, 4:59:34 PM8/21/12
to
Hello everyone,

Two quick questions from a XUL newbie:
1. In Javascript, how can I detect I'm running in the context of XUL and not a plain Web page?
2. How can I know the name of the add-on who lead the call to my function? The add-on that I would find if I'd look at the call-stack.

Thanks a lot!

Yves Dolce

unread,
Aug 21, 2012, 8:02:49 PM8/21/12
to
And:
3. Can an executable be launched from an add-on?

Thanks again.

Yves Dolce

unread,
Aug 21, 2012, 8:08:19 PM8/21/12
to
Hmmm... Talking about XUL under/with Firefox of course.

Y a Personne

unread,
Aug 21, 2012, 9:11:52 PM8/21/12
to
Yes, but Mozilla not like this function

reverendlinux

unread,
Aug 21, 2012, 9:31:39 PM8/21/12
to
Really? How?

Neil

unread,
Aug 22, 2012, 5:13:15 AM8/22/12
to
reverendlinux wrote:

>On Aug 21, 7:11 pm, Y a Personne <yaperso...@gmail.com> wrote:
>
>
>>Le 22/08/2012 02:02, Yves Dolce a écrit :
>>
>>>3. Can an executable be launched from an add-on?
>>>
>>>
>>Yes, but Mozilla not like this function
>>
>>
>Really? How?
>
>
I think AMO will require specific editorial review to ensure that you
don't abuse this before you can host your addon there.

--
Warning: May contain traces of nuts.

Y a Personne

unread,
Aug 22, 2012, 6:12:53 AM8/22/12
to
With XPCom.

This code start the calculator on Windows



const Cc = Components.classes;
const Ci = Components.interfaces;


var aFile = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile);

aFile.initWithPath('C:\\windows\\system32\\calc.exe');

aFile.launch();

reverendlinux

unread,
Aug 22, 2012, 10:04:33 AM8/22/12
to
Simple! Thanks...

Yves Dolce

unread,
Aug 22, 2012, 6:03:19 PM8/22/12
to
It looks like being able to retrieve Components.stack is enough to detect if I'm coming from XUL and not JS on a web page...
0 new messages