Bug 1235056 - PluginCrashReporterDisplayed event now only shown if the crash reporter can actually be shown and event is not accessible to web content.
MozReview-Commit-ID: 2hHgTR1Zqb1
--- a/browser/modules/PluginContent.jsm
+++ b/browser/modules/PluginContent.jsm
@@ -951,32 +951,34 @@ PluginContent.prototype = {
let runID = plugin.runID;
if (isShowing) {
// If a previous plugin on the page was too small and resulted in adding a
// notification bar, then remove it because this plugin instance it big
// enough to serve as in-content notification.
this.hideNotificationBar("plugin-crashed");
doc.mozNoPluginCrashedNotification = true;
+
+ // Notify others that the crash reporter UI is now ready
+ let winUtils = this.content.QueryInterface(Ci.nsIInterfaceRequestor)
+ .getInterface(Ci.nsIDOMWindowUtils);
+ let event = new this.content.CustomEvent("PluginCrashReporterDisplayed", {bubbles: true});
+ winUtils.dispatchEventToChromeOnly(plugin, event);
} else {
// If another plugin on the page was large enough to show our UI, we don't
// want to show a notification bar.
if (!doc.mozNoPluginCrashedNotification) {
this.global.sendAsyncMessage("PluginContent:ShowPluginCrashedNotification",
{ messageString: message, pluginID: runID });
// Remove the notification when the page is reloaded.
doc.defaultView.top.addEventListener("unload", event => {
this.hideNotificationBar("plugin-crashed");
}, false);
}
}
-
- // Notify others that the crash reporter UI is now ready
- this.global.content.dispatchEvent(
- new this.global.content.CustomEvent("PluginCrashReporterDisplayed", {bubbles: true}));
},
NPAPIPluginCrashReportSubmitted: function({ runID, state }) {
this.pluginCrashData.delete(runID);
let contentWindow = this.global.content;
let cwu = contentWindow.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindowUtils);
let plugins = cwu.plugins;