bugGnash - The GNU Flash player - Bugs: bug #37223, JavaScript call didn't reach the...

 
 

bug #37223: JavaScript call didn't reach the ExternalInterface callback

Submitted by:  Nutchanon Wetchasit <nachanon>
Submitted on:  Thu 30 Aug 2012 09:09:26 AM UTC  
Votes:  25  
 
Category: pluginSeverity: 3 - Normal
Release: 0.8.10Status: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 04 Aug 2015 11:35:01 AM UTC, comment #3:

This is an excellent bug report, I really hope to find the time to deal with it, but being extremely busy it would help if you could turn your test into a self-contained one (see other tests under testsuite/misc-mtasc.all) and ideally provide a patch to fix the code (doesn't sound too hard now that you found the culprit)

Sandro Santilli <strk>
Project Member
Tue 04 Aug 2015 11:08:16 AM UTC, comment #2:

This issue is still reproducible under current git version of Gnash.

The root cause of this issue seems to be that Gnash uses the first argument in
`ExternalInterface.addCallback(methodName,instance,method)` to make the browser
aware of the registered callback, *but not using it to look up for a real
ActionScript function to call*.

Instead, Gnash tries to call `_root.methodName`, which is incorrect.

I've created HTML file and test flash file (using MTASC) to demonstrate the
root cause, by using two anonymous function, one registered as
ExternalInterface call named `script_call`, another one assigned to a variable
`_root.script_call`.

When running `js2flash-rootcb.html` on browser with Adobe Flash Player:
After 3 sec, you'd see that ExternalInterface-registered callback is called correctly.

When running `js2flash-rootcb.html` on browser with Gnash current 0.8.11dev git:
After 3 sec, you'd see that callback in _root is called instead of ExternalInterface-registered one.

Test Flash/HTML file, source code, build scripts and full debug logs with
screenshots of both cases are attached (js2flash-rootcb.zip).

Gnash: 0.8.11dev (git 6b269f9 24-May-2015) NPAPI
Adobe Flash Player: 11.2 r202 (11.2.202.491) NPAPI binary
Browser: Iceweasel 10.0.12 (debian)
System: Debian GNU/Linux 7.0 Wheezy i386

(file #34574)

Nutchanon Wetchasit <nachanon>
Tue 19 Mar 2013 10:45:16 AM UTC, comment #1:

This problem still persists on current 0.8.11-git build
with exactly same trace message.

Gnash: Gnash 0.8.11dev master-21707-b482bd6 with 80989fcd, dfba5258 and 4b3dae97 reverted.
Browser: iceweasel 3.0.6-3 from Debian main repository (no addons)
System: Debian GNU/Linux 5.0 Lenny on i386

Nutchanon Wetchasit <nachanon>
Thu 30 Aug 2012 09:09:26 AM UTC, original submission:

This is a spin-off from bug #37008 (SoundCloud issue).

I've tried to call my test flash's method from JavaScript land,
using Flash 8-style ExternalInterface callback that's expected
to recieve the parameters "Hello" and "World" from JavaScript land,
and return "Too" back to the JavaScript land.

The ActionScript callback method was coded like this

The callback was invoked correctly under Adobe Flash Player (with proper security settings),
but doesn't under Gnash.

This is a trace output from Adobe Flash Player 11:

callee: load
callee: finished loading
status: load
status: finished loading
status: load
status: finished loading
callee: first run
callee: external initializing
callee: adding callback
callee: finished first run
callee: callback entered
callee: callback succeeded, expected (Hello,World) got (Hello,World)
callee: callback finished

You may see that the ActionScript callback function was invoked.

This is a trace output result from Gnash:

2929:1] 292 TRACE: callee: load
2929:1] 292 TRACE: callee: finished loading
2929:1] 292 TRACE: callee: first run
2929:1] 292 TRACE: callee: external initializing
2929:1] 293 TRACE: callee: adding callback
2929:1] 294 TRACE: callee: finished first run
2929:1] 384 TRACE: status: load
2929:1] 384 TRACE: status: finished loading
2929:1] 384 TRACE: status: load
2929:1] 384 TRACE: status: finished loading

You may see that the ActionScript callback was not invoked.
From JavaScript perspective, the call returns null.

Note that a group of lines like this appeared in the log every time that I tried to call this ExternalInterface callback
(The "121 bytes" part of the log was consistent; it's always 121)

2929:1] 2796 DEBUG: There are 121 bytes in the network buffer
2929:1] 2796 DEBUG: bool gnash::movie_root::processInvoke(gnash::ExternalInterface::invoke_t*) enter
2929:1] 2796 DEBUG: Processing script_call call from the Browser.
2929:1] 2796 DEBUG: bool gnash::movie_root::processInvoke(gnash::ExternalInterface::invoke_t*) returning

Full Gnash debug log (verbosity = 2), also attached here.
http://www.mediafire.com/?db433qgumndy3dy

This is my test flash file and source, accompanied with HTML page,
created from Adobe Flash CS3 with Flash 8 target, also attached here.
http://www.mediafire.com/?3c9737f29embsis

Gnash: gnash 0.8.10-1~lenny, browser-plugin-gnash 0.8.10-1~lenny (both from getgnash.org APT repository)
Browser: iceweasel 3.0.6-3 from Debian main repository (no addons)
System: Debian GNU/Linux 5.0 Lenny on i386

Nutchanon Wetchasit <nachanon>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #34574:  js2flash-rootcb.zip added by nachanon (7kB - application/zip - Test Flash/HTML file on _root callback case, with debug logs and screenshots)
file #26447:  js2flash.zip added by nachanon (3kB - application/zip - Test flash file, source code and Gnash debug log)
file #26448:  iceweasel3.0-gnash0.8.10-js2flash.log.txt added by nachanon (4kB - text/plain - Test flash file, source code and Gnash debug log)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by strk (Posted a comment)
  • -unavailable- added by nachanon (Voted in favor of this item)
  • -unavailable- added by nachanon (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 25 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 04 Aug 2015 11:08:16 AM UTCnachanonAttached File-=>Added js2flash-rootcb.zip, #34574
    Mon 11 Mar 2013 07:24:47 AM UTCnachanonCarbon-Copy-=>Added nachanon
    Thu 30 Aug 2012 09:09:26 AM UTCnachanonAttached File-=>Added js2flash.zip, #26447
      Attached File-=>Added iceweasel3.0-gnash0.8.10-js2flash.log.txt, #26448

    Back to the top


    Powered by Savane 3.1-cleanup