Closed Bug 1139434 Opened 11 years ago Closed 11 years ago

NPAPI race conditions due to IPC

Categories

(Firefox :: Untriaged, defect)

36 Branch
x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: szanto.cosmin, Unassigned)

Details

Attachments

(1 file)

Attached file IcpAssumedBug.zip
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0 Build ID: 20150223114739 Steps to reproduce: I have one plugin which can create two types of instances and I can add one to another using JavaScript. I create the second instance in js added it to the document and try to add it ti the second plugin, but the second instance is not created in time. NPN_Invoke on the first object is called earlier than NPP_New for the second instance. I've attached a test. Actual results: The object which is given to NPN_Invoke for the first instance is an uninitialized object. Expected results: The second instance of the object should have been created when it was added to the document, earlier than the invoke to the first instance.
Version: 35 Branch → 36 Branch
function onAdd() { document.getElementById("added").innerHTML = ""; var a = document.getElementById("a"); var b = document.createElement("embed"); b.setAttribute("type", "application/x-b"); document.getElementById("added").appendChild(b); // The following will force the object creation // b.getId(); try { a.add(b); console.log("Success"); } catch(e) { console.error(e); } } So you have the workaround already, which is to script instance B before you pass it to instance A. I think this is an intentional behavior of Firefox and so this is not a bug.
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: