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

Call javascript function

10 views
Skip to first unread message

Harry

unread,
Sep 28, 2006, 3:30:24 AM9/28/06
to dev-tech-...@lists.mozilla.org

Hello friends I want to call javascript function on web page from a Mozilla
extension. The functions are in JS files included in web page and i want to
call those from for example my toolbar attached to the Mozilla browser.

I have problem only with Mozilla browser.

PLease Help

Thanks in advance

Harry


--
View this message in context: http://www.nabble.com/Call-javascript-function-tf2349169.html#a6541588
Sent from the Mozilla - JavaScript Engine mailing list archive at Nabble.com.

Nickolay Ponomarev

unread,
Sep 28, 2006, 7:43:34 AM9/28/06
to Harry, dev-tech-...@lists.mozilla.org, dev-te...@lists.mozilla.org
[This is not a js-engine question, please followup to dev-tech-dom.]

On 9/28/06, Harry <haris...@greymatterindia.com> wrote:
>
> Hello friends I want to call javascript function on web page from a Mozilla
> extension. The functions are in JS files included in web page and i want to
> call those from for example my toolbar attached to the Mozilla browser.
>

You can't call the functions in content because of XPCNativeWrappers.
Read the documentation at
http://developer.mozilla.org/en/docs/XPCNativeWrapper carefully, it
answers your question.

Note that accessing anything in the web page's script may lead to
security problems, so you shouldn't do this on pages that are not
guaranteed to be non-malcious.

Nickolay

Harry

unread,
Oct 30, 2006, 6:58:28 AM10/30/06
to dev-tech-...@lists.mozilla.org

Thanks Nickolay


But is there any method to do it,

means can we try to break security or can we define our functions in JS file
so that we can access them from toolbar.

Harish


--
View this message in context: http://www.nabble.com/Call-javascript-function-tf2349169.html#a7073106

Nickolay Ponomarev

unread,
Oct 30, 2006, 8:51:41 AM10/30/06
to Harry, dev-tech-...@lists.mozilla.org
On 10/30/06, Harry <haris...@greymatterindia.com> wrote:
> But is there any method to do it,

Yes, and it's described on the xpcnativewrapper page. You could also
search these groups for wrappedJSObject and evalInSandbox.

Nickolay

>
> means can we try to break security or can we define our functions in JS file
> so that we can access them from toolbar.
>
> Harish
>
>
>
>
> --
> View this message in context: http://www.nabble.com/Call-javascript-function-tf2349169.html#a7073106
> Sent from the Mozilla - JavaScript Engine mailing list archive at Nabble.com.
>

> _______________________________________________
> dev-tech-js-engine mailing list
> dev-tech-...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-tech-js-engine
>

harish...@gmail.com

unread,
Nov 15, 2006, 7:08:12 AM11/15/06
to
Thanks dear friend,

i used sand box technique using "evalinsandbox" and it is working
fine.
But it will not work for Ajax function calls.

Is there any other solution

if yes then plz reply

Harry.....

0 new messages