Javascript running "under XUL" and add-on owner

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Javascript running "under XUL" and add-on owner

Yves Dolce
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!
_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Reply | Threaded
Open this post in threaded view
|

Re: Javascript running "under XUL" and add-on owner

Yves Dolce
And:
3. Can an executable be launched from an add-on?

Thanks again.
_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Reply | Threaded
Open this post in threaded view
|

Re: Javascript running "under XUL" and add-on owner

Yves Dolce
In reply to this post by Yves Dolce
Hmmm... Talking about XUL under/with Firefox of course.
_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Reply | Threaded
Open this post in threaded view
|

Re: Javascript running "under XUL" and add-on owner

Y a Personne
In reply to this post by Yves Dolce
Le 22/08/2012 02:02, Yves Dolce a écrit :
> And:
> 3. Can an executable be launched from an add-on?
>
> Thanks again.
>


Yes, but Mozilla not like this function
_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Reply | Threaded
Open this post in threaded view
|

Re: Javascript running "under XUL" and add-on owner

reverendlinux-2
On Aug 21, 7:11 pm, Y a Personne <[hidden email]> wrote:
> Le 22/08/2012 02:02, Yves Dolce a écrit :
>
> > And:
> > 3. Can an executable be launched from an add-on?
>
> > Thanks again.
>
> Yes, but Mozilla not like this function

Really?  How?
_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Reply | Threaded
Open this post in threaded view
|

Re: Javascript running "under XUL" and add-on owner

Neil-4
reverendlinux wrote:

>On Aug 21, 7:11 pm, Y a Personne <[hidden email]> 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.
_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Reply | Threaded
Open this post in threaded view
|

Re: Javascript running "under XUL" and add-on owner

Y a Personne
In reply to this post by reverendlinux-2
Le 22/08/2012 03:31, reverendlinux a écrit :

> On Aug 21, 7:11 pm, Y a Personne <[hidden email]> wrote:
>> Le 22/08/2012 02:02, Yves Dolce a écrit :
>>
>>> And:
>>> 3. Can an executable be launched from an add-on?
>>
>>> Thanks again.
>>
>> Yes, but Mozilla not like this function
>
> Really?  How?
>


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();

_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Reply | Threaded
Open this post in threaded view
|

Re: Javascript running "under XUL" and add-on owner

reverendlinux-2
On Aug 22, 4:12 am, Y a Personne <[hidden email]> wrote:

> Le 22/08/2012 03:31, reverendlinux a écrit :
>
> > On Aug 21, 7:11 pm, Y a Personne <[hidden email]> wrote:
> >> Le 22/08/2012 02:02, Yves Dolce a écrit :
>
> >>> And:
> >>> 3. Can an executable be launched from an add-on?
>
> >>> Thanks again.
>
> >> Yes, but Mozilla not like this function
>
> > Really?  How?
>
> 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();

Simple!  Thanks...
_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Reply | Threaded
Open this post in threaded view
|

Re: Javascript running "under XUL" and add-on owner

Yves Dolce
On Wednesday, August 22, 2012 7:04:33 AM UTC-7, reverendlinux wrote:

> On Aug 22, 4:12 am, Y a Personne <[hidden email]> wrote:
>
> > Le 22/08/2012 03:31, reverendlinux a écrit :
>
> >
>
> > > On Aug 21, 7:11 pm, Y a Personne <[hidden email]> wrote:
>
> > >> Le 22/08/2012 02:02, Yves Dolce a écrit :
>
> >
>
> > >>> And:
>
> > >>> 3. Can an executable be launched from an add-on?
>
> >
>
> > >>> Thanks again.
>
> >
>
> > >> Yes, but Mozilla not like this function
>
> >
>
> > > Really?  How?
>
> >
>
> > 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();
>
>
>
> Simple!  Thanks...

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...
_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul