There is no API that allows the hosting app to interact with embeded JS engine.

RESOLVED WONTFIX

Status

()

RESOLVED WONTFIX
11 years ago
8 years ago

People

(Reporter: jacek, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Reporter)

Description

11 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.5) Gecko/20070723 Firefox/2.0.0.5
Build Identifier: 1.9

Currently there is no way for the embedding app to execute JS code in browser's context. Eg. I need to execute a JS function, passing arguments to it. It's possible to do using IScriptContext, but it's a very internal interface. I've written a simple patch that adds a new nsIDOMScriptContainer interface to the document object. It's just a simple wrapper around nsIScriptContext. With this patch apps may access JS engine simply by XPCOM interfaces.

Reproducible: Always
(Reporter)

Comment 1

11 years ago
Created attachment 274789 [details] [diff] [review]
the patch
Attachment #274789 - Flags: review?(jonas)
There's no reason to expect GetScriptGlobalObject() to not return null.  Certainly when dealing with data documents or documents that are being unloaded, that will happen.
(Reporter)

Comment 3

11 years ago
Thanks for your quick reply. I'm attaching version with GetScriptGlobalObject() return value checks.
(Reporter)

Comment 4

11 years ago
Created attachment 274797 [details] [diff] [review]
an updated patch
Attachment #274797 - Flags: review?(bzbarsky)
(Reporter)

Updated

11 years ago
Attachment #274789 - Attachment is obsolete: true
Attachment #274789 - Flags: review?(jonas)
I think sicking is a better choice of reviewer...
(Reporter)

Updated

11 years ago
Attachment #274797 - Flags: review?(bzbarsky) → review?(jonas)
Comment on attachment 274797 [details] [diff] [review]
an updated patch

Passing the potato on to jst. He knows this better. FWIW though, the name of the interface isn't the best. Generally we use nsIDOM* interfaces for stuff that is exposed in the DOM.
Attachment #274797 - Flags: review?(jonas) → review?(jst)
(Reporter)

Comment 7

11 years ago
Created attachment 276675 [details] [diff] [review]
path

Thanks, here is a changed version (it's really just a s/nsIDOMScriptContainer/nsIScriptContainer/). If you have a suggestion for a better name, I will change it.
Attachment #274797 - Attachment is obsolete: true
Attachment #276675 - Flags: review?(jst)
Attachment #274797 - Flags: review?(jst)

Comment 8

11 years ago
ping.  What's Jacek's next move, guys?
Probably e-mailing jst and reminding him about this review request...
Status: UNCONFIRMED → NEW
Ever confirmed: true
(Reporter)

Updated

9 years ago
Attachment #276675 - Flags: review?(jst)
(Reporter)

Updated

8 years ago
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.