From ea88e835c9b7c46b450476efdf18263045a041d9 Mon Sep 17 00:00:00 2001 From: Benjamin Smedberg Date: Mon, 11 Nov 2013 16:11:12 -0500 Subject: [PATCH] Bug 883404 (UI portion) - Disable running plugins on the current page when the user chooses "Block", r=jaws --- browser/base/content/browser-plugins.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/browser/base/content/browser-plugins.js b/browser/base/content/browser-plugins.js index e67a85c4267..1e398c16330 100644 --- a/browser/base/content/browser-plugins.js +++ b/browser/base/content/browser-plugins.js @@ -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(); } },