Bug 883404 (UI portion) - Disable running plugins on the current page when the user chooses "Block", r=jaws

This commit is contained in:
Benjamin Smedberg 2013-11-11 16:11:12 -05:00
parent 3eff95c503
commit ea88e835c9

View File

@ -731,10 +731,6 @@ var gPluginHandler = {
let principal = contentWindow.document.nodePrincipal;
Services.perms.addFromPrincipal(principal, aPluginInfo.permissionString,
permission, expireType, expireTime);
if (aNewState == "block") {
return;
}
}
// Manually activate the plugins that would have been automatically
@ -752,19 +748,23 @@ var gPluginHandler = {
}
if (aPluginInfo.permissionString == pluginHost.getPermissionStringForType(plugin.actualType)) {
pluginFound = true;
if (gPluginHandler.canActivatePlugin(plugin)) {
let overlay = this.getPluginUI(plugin, "main");
if (overlay) {
overlay.removeEventListener("click", gPluginHandler._overlayClickListener, true);
if (aNewState == "block") {
plugin.reload(true);
} else {
if (gPluginHandler.canActivatePlugin(plugin)) {
let overlay = this.getPluginUI(plugin, "main");
if (overlay) {
overlay.removeEventListener("click", gPluginHandler._overlayClickListener, true);
}
plugin.playPlugin();
}
plugin.playPlugin();
}
}
}
// 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) {
if (aNewState != "block" && !pluginFound) {
browser.reload();
}
},