Closed Bug 1047145 Opened 10 years ago Closed 10 years ago

Implement Shumway ExternalInterface

Categories

(Firefox Graveyard :: Shumway, defect, P1)

defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: cpeterson, Assigned: yury)

References

Details

No description provided.
QA Contact: mwobensmith
We can defer ExternalInterface support from M2 to a later milestone because Yury says the most common use cases for ExternalInterface are clipboard and document.location, which we don't need yet.
Blocks: shumway-m3
No longer blocks: shumway-m2
Last good revision: 82df3654cd80 (2014-07-23) First bad revision: a91ec42d6a9c (2014-07-24) Pushlog: https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=82df3654cd80&tochange=a91ec42d6a9c
Too many revisions were skipped during bisecting, but possible bug that broke Shumway's external interface functionality could be bug 742444. Right now we setup a sandbox and running script the following way (see also [1]): wrappedWindow.__flash__toXML = function __flash__toXML(obj) { ... }; ... var sandbox = new Cu.Sandbox(wrappedWindow, {sandboxPrototype: wrappedWindow}); wrappedWindow.__flash__eval = function (evalInSandbox, sandbox, expr) { return evalInSandbox(expr, sandbox); }.bind(wrappedWindow, Cu.evalInSandbox, sandbox); When __flash__eval('__flash__toXML(0)') is executed, after bug 742444 (?) landing, the code fails: it cannot find __flash__toXML. Bobby, what will be the right way to produce the same effect as in earliest versions of FF? Thanks [1] http://mxr.mozilla.org/mozilla-central/source/browser/extensions/shumway/content/ShumwayStreamConverter.jsm#708
Flags: needinfo?(bobbyholley)
This seems overly-complicated. How about: wrappedWindow.__flash__toXML = function __flash__toXML(obj) { ... }; var sandbox = new Cu.Sandbox(wrappedWindow, {sandboxPrototype: wrappedWindow}); wrappedWindow.__flash__eval = sandbox.eval;
Flags: needinfo?(bobbyholley)
(In reply to Bobby Holley (:bholley) from comment #4) > This seems overly-complicated. How about: > var sandbox = new Cu.Sandbox(wrappedWindow, {sandboxPrototype: > wrappedWindow}); > wrappedWindow.__flash__eval = sandbox.eval; Does not help: returns undefined (and I cannot receive any other feedback).
Does the flash sandbox need any sort of security protections when interacting with the content? If not, you should probably add { wantXrays: false } to the sandbox options (and we _do_ need security protections, you should be using an nsExpandedPrincipal, and passing [wrappedWindow] instead of wrappedWindow). Regardless of all of that though, the snippet from comment 4 should work. If it doesn't, you'll either need to debug it, or put together a reduced testcase that I can look at.
Looks like you are right, the previous code can be simplified and used without Sandbox usage, see https://github.com/yurydelendik/shumway/commit/7e0957fa3234250cd6c3d53bef240fddc380551d
Priority: -- → P2
Till says ExternalInterface is both really close to working and mandatory for M3.
Priority: P2 → P1
Blocks: 1071700
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Looks great for AVM2. \o/ AVM1, however, works only in the outbound, SWF-to-JS case. The inbound stuff doesn't appear to be working. Examples for both: http://people.mozilla.org/~mwobensmith/flash/external_interface/external_interface_avm1.html http://people.mozilla.org/~mwobensmith/flash/external_interface/external_interface_avm2.html Please let me know if I can help.
Currently we are using the same class for AVM1 as for AVM2, but apparently they have different interfaces and method signatures (per http://help.adobe.com/en_US/AS2LCR/Flash_10.0/help.html?content=00001037.html). We probably want to clone this bug for AS2.
Depends on: 1077158
Fixed. Verified with today's add-on. At some point, we'll need to do a deeper test pass on ExternalInterface, but basic functionality is there.
Status: RESOLVED → VERIFIED
Product: Firefox → Firefox Graveyard
You need to log in before you can comment on or make changes to this bug.