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()

Submitted by:  Nutchanon Wetchasit <nachanon>
Submitted on:  Tue 12 Jan 2016 12:23:39 PM UTC  
 
Category: coreSeverity: 3 - Normal
Release: masterStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

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:

Gnash's console output from the run:

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:

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:

Gnash's console output from the run:

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:

Player's trace output from the run:

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:

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:

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 File(s):
   
   
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
  • -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 0 encouragements so far.

    Only logged-in users can vote.

     

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

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 12 Jan 2016 12:33:16 PM UTCnachanonAttached File-=>Added flash2js-zeroarg.zip, #35999

    Back to the top


    Powered by Savane 3.1-cleanup1