Bug 20305

Summary: NPAPI: === returns false for identical NPObjects returned from a plugin.
Product: WebKit Reporter: Jeremy Moskovich <playmobil>
Component: Plug-insAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: andersca, ap, duncantebbs, michaelbraithwaite, tulrich, zwarich
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   

Description Jeremy Moskovich 2008-08-06 09:23:02 PDT
The === JS operator appears to have a bug when comparing identical NPObjects returned from a plugin.

a = plugin.getObject();
b = plugin.getObject(); // Returns the same underlying object as the one above.

// a === b is false, a == b is true.

alert(a); // NPObject 0x865c3d4, NPClass 0x4d7e780
alert(b); // NPObject 0x865c3d4, NPClass 0x4d7e780
alert(typeof(a)); // object
Comment 1 Mark Rowe (bdash) 2008-08-06 14:53:29 PDT
<rdar://problem/6130751>
Comment 2 Jeremy Moskovich 2008-08-06 22:05:58 PDT
Correction == returns false as well.
Comment 3 Thatcher Ulrich 2008-10-27 15:42:45 PDT
See https://bugs.webkit.org/show_bug.cgi?id=20305 for specific repro steps.
Comment 4 Thatcher Ulrich 2009-10-15 09:37:26 PDT
Link to Chromium bug w/ specific repro steps: http://code.google.com/p/chromium/issues/detail?id=3786
Comment 5 michaelbraithwaite 2011-06-14 07:55:49 PDT
Another Chrome bug on the same === failing issue has a recent fix for it. 

See http://code.google.com/p/chromium/issues/detail?id=5751
Comment 6 duncantebbs 2012-01-30 20:54:27 PST
The problem appears to exist in the other direction too, i.e. when passing objects from JS to the plugin.

  var a = {};
  plugin.f(a, a); 

The plugin sees an argument list containing two different NPObject pointers.  On Firefox and Chrome, the same NPObject pointer appears twice in the list, allowing the plugin to test whether the arguments are the same.
Comment 7 Alexey Proskuryakov 2012-01-30 21:40:51 PST
This bug is in a pretty much useless state. Is it about Chrome or Safari, WebKit1 or WebKit2?
Comment 8 duncantebbs 2012-01-30 22:05:50 PST
I've created a new bug for the JS -> plugin direction (which was under Safari)

https://bugs.webkit.org/show_bug.cgi?id=77404
Comment 9 Anders Carlsson 2016-05-30 11:14:01 PDT
I think this works with WebKit2. If it doesn't work, we're not likely to fix it - our plug-in code is in maintenance mode only.