weird "Error calling method on NPObject" error




13 years ago
6 years ago


(Reporter: bugzilla, Unassigned)


Bug Flags:
blocking1.9 -
wanted1.9 +

Firefox Tracking Flags

(Not tracked)




(1 attachment)



13 years ago
if you go to (flash installed needed)
and press the Menu button just right of the logo I see this in the console:

Error: Error calling method on NPObject!
Source File:
Line: 865

what does this mean and why do I get this error when the flash menu shows?

Comment 1

13 years ago
User Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1)
Gecko/20050915 Firefox/1.6a1


13 years ago
Component: General → Plug-ins
Product: Firefox → Core
QA Contact: general → plugins
Version: unspecified → Trunk

Comment 2

13 years ago
This is very probably a duplicate of bug 309044 (which has a test case or two)

Comment 3

13 years ago
damn. this bug is still present with the fix for bug 309044 in :(

Comment 4

13 years ago
Michelle is this only a issue in the Flash 8 plugin or is it a mozilla issue?

to reproduce:
and press the Menu button just right of the logo

Comment 5

13 years ago
From the plug-in side, here is what is going on:

- NPP_GetValue for NPPVpluginScriptableNPObject is called on plug-in.
- plug-in calls NPN_CreateObject
- NP_Allocate is called on plug-in
- plug-in calls NPN_RetainObject
- NP_Deallocate is called on plug-in

- NPP_GetValue for NPPVpluginScriptableNPObject is called on plug-in.
- plug-in calls NPN_CreateObject
- NP_Allocate is called on plug-in
- plug-in calls NPN_RetainObject

- NPP_GetValue for NPPVpluginScriptableNPObject is called on plug-in.
In this case, we already have an object, so we don't need to create one.
- plug-in calls NPN_RetainObject (as advised by Brendan)

then at browser shutdown:
- NP_Deallocate is called on plug-in

I don't know if this is a browser or plug-in problem but my guess would be it is a browser issue.

Comment 6

13 years ago
Johnny: any chance you could take a look on this and check if this is a browser bug or a plugin bug. it seems like a browser bug.
Flags: blocking1.9a1?

Comment 7

13 years ago
Additional info:
This problem is reproduced in Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7 with flash plug-in 8,0,22,0 under WinXP.

Message "Error calling methods on NPObject!" appears on JavaScript console when I try to initialize flash variable using SetVariable() method (note, that PercentLoaded() already returned 100 and IsPlaying() returned true). Using try {} catch {} cannot handle this error. 

The error is reproduced periodically. Attempts to perform SetVariable() after time interval about 10 milliseconds after PercentLoaded() reached 100 frequently cause errors. When time interval is about 200 milliseconds and more, the error not appears.

Comment 8

12 years ago
Created attachment 233081 [details]
Testcase in Mozilla archive (Zip with RDF)

Unzip or use <a href="">Mozilla Archive Format</a>.

PS: reports Flash 6 doesn't cause the error.

Comment 9

12 years ago
This is an NPRuntime issue, which is a feature first used in Flash Player 8. Thus, Flash Player 6 wouldn't exhibit this issue. At that time, XPConnect was used for JavaScript interaction.

Comment 10

12 years ago
All weird Flash behaviour disappeared once i tested via a web server. (junction to project folder in Apache htdocs)

It'd be nice to have a clear notification from Flash.

Comment 11

12 years ago
The original test case in comment #1 no longer reproduces this bug for me, potentially because they changed the site, not sure. I've tried Firefox on WinXP with both Flash Player 8 and Flash Player 9r16. Is there still a valid way to repro this issue? Should the attachment in comment #8 be run locally?

Comment 12

12 years ago
My testcase shows the bug when run locally.

Comment 13

12 years ago
CT, I am trying reproduce the "Error calling mathod on NPObject" JavaScript console error you are seeing, but so far I don't see it. Here's what I'm doing:

1. Store the testcase locally on your machine
2. Launch Win Firefox on Win XP
3. Open the JavaScript console
4. From the local location, open index.htm
5. Click Pass the variable
6. Click Probe Flash Object

I see nothing in the JavaScript console window with either Flash Player 8 or 9.

Comment 14

12 years ago
Flash player 8,0,22,0 in Opera 9.01 returns "undefined".
Flash player 8,0,24,0 in IE6 returns "hello".
Flash player 8,0,22,0 in Firefox gets "Error calling method on NPObject!"

I'll try updating Flash player. At work i think i have beta 9 though.

Comment 15

12 years ago
I ran the Flash Player 9,0,16,0 installer from Firefox and it didn't list Opera 9.01, although i did have to close it as well before installing.

No difference in results.
Attachment #233081 - Attachment mime type: application/octet-stream → application/zip
So can someone on Windows reproduce the problem?  Martijn?  Or gavin?  I clearly can't on Linux (where the latest Flash is 7.x), and my attempts to actually install Flash on Windows were met with complete failure (both via the plug-in wizard and directly off the Macromedia site) -- Firefox just doesn't see the plug-in.
(In reply to comment #16)
> So can someone on Windows reproduce the problem?  Martijn?  Or gavin?

Yes, I can reproduce the issue, using a recent trunk debug build and "Shockwave Flash 8.0 r24" (according to about:plugins). The stack to the code that throws the exception is . You can ping me on IRC if you want more details.
Bz helped me debug a bit. I reproduced the bug locally by downloading the attached testcase and running it in a trunk debug build. The exception is thrown at:
because ok is 0 after:

The method being invoked on the plugin is "SetVariable" (*(JSString*)(method &~7)).

Strangely enough, I was not able to reproduce the bug after uploading the file to a server and accessing it via http. The call to SetVariable succeeds in that case (perhaps a timing issue?).

Comment 19

12 years ago
I do get this error too; moreover try-catch somehow doesn't work (in order to "mute" the error message)
Flash 9.0 r16 + FF


12 years ago
Flags: blocking1.9a1? → blocking1.9-
Keywords: qawanted
Whiteboard: [wanted-1.9]

Comment 20

12 years ago
Reproduced with Mozilla/5.0 (Firefox 2.0; Kubuntu) Gecko ID:0000000000${Flags} using testcase. Shockwave Flash 9.0 d78. OS should be All.

Error calling method on NPObject!
index.htm (line 22)
passFlashindex.htm (line 22)
onclickindex.htm (line 1)
Flags: wanted1.9+
Whiteboard: [wanted-1.9]

Comment 21

10 years ago
I'm still getting this with Flash 10.0 r15, Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/2009021904 GranParadiso/3.0.8pre ID:2009021904

It happens within URL , but unfortunately that URL seems to only work in as an iframe for a page that I can no longer find.

Since I'm getting this on Linux I'm changing the platform to "All".
OS: Windows XP → All
I confirm the error on linux using the testcase from comment 8.  Error console throws the NPObject error.


Tested on: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20090729 Firefox/3.5.2

Comment 23

9 years ago
I'm having similar problem with our own plugin. While there seems to be no problems with property access (read or write) method calls are failing with the 
"NPMethod called on non-NPObject wrapped JSObject!" exception. Trapping in gdb shows that the object class is in fact something named "XPCCrossOriginWrapper" rather than &sNPObjectJSWrapperClass but I'm at loss with what to do with that information.

Comment 24

9 years ago
Oh, just realized I'm calling the plugin from chrome. Doing the same from web page is working fine. My problem is probably different.

Comment 25

7 years ago
I confirm the error on Windows XP using the testcase from comment 8.  Error console throws the NPObject error.

"Pass the variable"
Errore: Error calling method on NPObject!
File sorgente: file:///D:/Comodo/Downloads/1155224924795_0/index.htm
Riga: 22

"Probe Flash object"
Errore: Error enumerating properties on scriptable plugin object
File sorgente: file:///D:/Comodo/Downloads/1155224924795_0/index.htm
Riga: 33

Mozilla/5.0 (Windows NT 5.1; rv:10.0.2) Gecko/20100101 Firefox/10.0.2
Shockwave Flash / File: NPSWF32.dll / Versione: / Shockwave Flash 11.1 r102
I confirm comment 25 on Nightly 21.0a1 (2013-01-27) Win 7 x64.
Keywords: qawanted


6 years ago
Priority: -- → P3
This error also occurs in chromium - it's entirely possible its a flash NPAPI issue.

Comment 28

6 years ago
Yeah, let's not track this further; it can certainly happen if the Actionscript method in Flash throws an error.
Last Resolved: 6 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.