diff --git a/dom/plugins/ipc/PluginModuleParent.cpp b/dom/plugins/ipc/PluginModuleParent.cpp index 3f02b60f9af8..7a67e8112f2b 100644 --- a/dom/plugins/ipc/PluginModuleParent.cpp +++ b/dom/plugins/ipc/PluginModuleParent.cpp @@ -2756,6 +2756,19 @@ PluginModuleParent::NPP_NewInternal(NPMIMEType pluginType, NPP instance, // Now replace it with the instance instance->pdata = static_cast(parentInstance); + // Any IPC messages for the PluginInstance actor should be dispatched to the + // DocGroup for the plugin's document. + RefPtr owner = parentInstance->GetOwner(); + nsCOMPtr elt; + owner->GetDOMElement(getter_AddRefs(elt)); + if (nsCOMPtr node = do_QueryInterface(elt)) { + nsCOMPtr doc = node->OwnerDoc(); + if (doc) { + nsCOMPtr eventTarget = doc->EventTargetFor(dom::TaskCategory::Other); + SetEventTargetForActor(parentInstance, eventTarget); + } + } + if (!SendPPluginInstanceConstructor(parentInstance, nsDependentCString(pluginType), mode, names, values)) {