bugGnash - The GNU Flash player - Bugs: bug #46878, Gnash refused to call...

 
 

bug #46878: Gnash refused to call zero-parameter JavaScript function via ExternalInterface.call()

Submitter:  Nutchanon Wetchasit <nachanon>
Submitted:  Tue 12 Jan 2016 12:23:39 PM UTC
   
 
Category:  core Severity:  3 - Normal
Release:  master Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 04 Feb 2016 10:02:48 AM UTC, comment #5: 

On current git version of Gnash, zero-argument function call from Flash
to JavaScript via `ExternalInterface.call()` seems to be done properly:

Text output from `flash2js-zeroarg.html` under browser with Gnash:

js_function callback is called.


Gnash's console output from the run:

67 SECURITY: Extensions disabled
67 UNIMPLEMENTED: FileAttributes tag in the SWF requests that network access is not granted to this movie (or application?) when loaded from the filesystem. Anyway Gnash won't care; use white/black listing in your .gnashrc instead
92 TRACE: flash2js-zeroarg: js_function returned: Hello!


You'd see that zero-argument call to JavaScript function is now working,
and returning value properly.

If I tried to revert the original fix, and run `make check`, I'm now getting
the expected test failures:

 --=[ testsuite/misc-mtasc.all ]=--
FAIL: extcommtests-runner: Gnash should call JavaScript's js_simple function correctly ("" != "<invoke name="js_simple" returntype="xml"><arguments><string>js_simple</string></arguments></invoke>")
FAIL: extcommtests-runner: expected: "Correct" , obtained: "undefined"  [extcomm.as:142]


So, this bug could now be marked as fixed.

Gnash: 0.8.11dev (git 02ec1e6 3-Feb-2016)
Browser: Iceweasel 10.0.12 (debian)
System: Debian GNU/Linux 7.0 Wheezy i386

Nutchanon Wetchasit <nachanon>
Sun 24 Jan 2016 10:03:02 AM UTC, comment #4: 

Automated test for this issue is now included.
See patch #8853 comment 3.

Gnash: 0.8.11dev (patched against git 62cfdfe 16-Jan-2016)
Browser: Iceweasel 10.0.12 (debian)
System: Debian GNU/Linux 7.0 Wheezy i386

Nutchanon Wetchasit <nachanon>
Tue 12 Jan 2016 04:42:54 PM UTC, comment #3: 

Patch included, see patch #8853.

After applied the patch, this is text output from `flash2js-zeroarg.html` under browser with Gnash:

js_function callback is called.


Gnash's console output from the run:

79 TRACE: flash2js-zeroarg: js_function returned: Hello!


You'd see that the JavaScript function is now called, and return value is
correctly passed back to ActionScript.

Gnash: 0.8.11dev (patched against git 6671ff0 12-Jan-2016)
Browser: Iceweasel 10.0.12 (debian)
System: Debian GNU/Linux 7.0 Wheezy i386

Nutchanon Wetchasit <nachanon>
Tue 12 Jan 2016 04:30:46 PM UTC, comment #2: 

This seems to be caused by an incorrect argument number check in Gnash's
`ExternalInterface.call()` implementation, as it rejects call with 1 argument
which is supposed to be allowed since the only required argument in
`ExternalInterface.call()` is the first one (target JavaScript function name).

Nutchanon Wetchasit <nachanon>
Tue 12 Jan 2016 12:33:16 PM UTC, comment #1: 

I have created a simple Flash file (Flash 8) using libming's `makeswf`
with a HTML container to demonstrate the issue, attached as
`flash2js-zeroarg.zip`. JavaScript function `js_function()` prints a line
"js_function callback is called." to HTML page and returns a string "Hello!".

Text output from running `flash2js-zeroarg.html` under browser with Flash Player:

js_function callback is called.


Player's trace output from the run:

flash2js-zeroarg: js_function returned: Hello!


You'd see that the JavaScript function was called, and return value was passed
back to ActionScript properly.

Text output from running `flash2js-zeroarg.html` under browser with Gnash:



Gnash's console output from the run:

74 TRACE: flash2js-zeroarg: js_function returned: undefined


You'd see that the JavaScript function was not called (no output on HTML page),
and `undefined` value was returned to ActionScript.

Text output, screenshots, full debug/trace output (verbosity 2 + action error),
and Gnash's player-container communication logs are also attached in `flash2js-zeroarg.zip`.

Gnash: 0.8.11dev (git 15d61a8 26-Dec-2015) NPAPI
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 #35999)

Nutchanon Wetchasit <nachanon>
Tue 12 Jan 2016 12:23:39 PM UTC, original submission:  

While I was testing around bug #46131 (ExternalInterface.call return issue),
I found that if Flash file tried to call a simple zero-argument
JavaScript function via Flash 8-style ExternalInterface using a code like this:


flash.external.ExternalInterface.call("js_function");


Under browser with Flash Player, a JavaScript function named "js_function"
would be called and its return value would be passed back to ActionScript
as `ExternalInterface.call()`'s return value.

But under browser with Gnash plugin, the JavaScript function was not called,
and `ExternalInterface.call()` returned `undefined` value.

According to Gnash's container-player communication log in this case,
the player never send "<invoke>" command to the container, thus
the JavaScript function was never called.

Note: This issue is specific to zero argument function call.
Calling JavaScript function with one or more argument (even the target
function doesn't accept it) will get the target function called properly.

Gnash: 0.8.11dev (git 15d61a8 26-Dec-2015) NPAPI
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

Nutchanon Wetchasit <nachanon>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #35999:  flash2js-zeroarg.zip added by nachanon (5KiB - application/zip - Test Flash file, source code, HTML container, screenshot, and logs)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by nachanon (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-01-12 nachanon Attached File- Added flash2js-zeroarg.zip, #35999

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code