Bug 926605 part B - automatically refresh the page if the users chooses to enable a plugin but its no longer on the page, r=jaws

This commit is contained in:
Benjamin Smedberg 2013-10-27 14:41:29 -04:00
parent f1747357ee
commit 6fb5b50080

View File

@ -715,6 +715,7 @@ var gPluginHandler = {
let plugins = cwu.plugins;
let pluginHost = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost);
let pluginFound = false;
for (let plugin of plugins) {
plugin.QueryInterface(Ci.nsIObjectLoadingContent);
// canActivatePlugin will return false if this isn't a known plugin type,
@ -726,8 +727,15 @@ var gPluginHandler = {
overlay.removeEventListener("click", gPluginHandler._overlayClickListener, true);
}
plugin.playPlugin();
pluginFound = true;
}
}
// If there are no instances of the plugin on the page any more, what the
// user probably needs is for us to allow and then refresh.
if (!pluginFound) {
browser.reload();
}
},
_showClickToPlayNotification: function PH_showClickToPlayNotification(aBrowser, aPlugin, aShowNow) {