diff --git a/browser/base/content/browser-plugins.js b/browser/base/content/browser-plugins.js index 2cff765784c9..2d3fdf8fef83 100644 --- a/browser/base/content/browser-plugins.js +++ b/browser/base/content/browser-plugins.js @@ -156,7 +156,7 @@ var gPluginHandler = { case "block": permission = Ci.nsIPermissionManager.PROMPT_ACTION; - expireType = Ci.nsIPermissionManager.EXPIRE_SESSION; + expireType = Ci.nsIPermissionManager.EXPIRE_NEVER; expireTime = 0; histogram.add(2); switch (aPluginInfo.blocklistState) { @@ -259,6 +259,8 @@ var gPluginHandler = { if (plugins.length == 1) { let pluginInfo = plugins[0]; + let isWindowPrivate = PrivateBrowsingUtils.isWindowPrivate(window); + let active = pluginInfo.fallbackType == Ci.nsIObjectLoadingContent.PLUGIN_ACTIVE; let options = { @@ -306,21 +308,25 @@ var gPluginHandler = { accessKey: gNavigatorBundle.getString("flashActivate.allow.accesskey"), dismiss: true, }; - let secondaryActions = [{ - callback: () => { - let browserRef = weakBrowser.get(); - if (browserRef) { - if (pluginInfo.fallbackType == Ci.nsIObjectLoadingContent.PLUGIN_ACTIVE) { - this._updatePluginPermission(browserRef, pluginInfo, "block"); - } else { - this._updatePluginPermission(browserRef, pluginInfo, "continueblocking"); + + let secondaryActions = null; + if (!isWindowPrivate) { + secondaryActions = [{ + callback: () => { + let browserRef = weakBrowser.get(); + if (browserRef) { + if (pluginInfo.fallbackType == Ci.nsIObjectLoadingContent.PLUGIN_ACTIVE) { + this._updatePluginPermission(browserRef, pluginInfo, "block"); + } else { + this._updatePluginPermission(browserRef, pluginInfo, "continueblocking"); + } } - } - }, - label: gNavigatorBundle.getString("flashActivate.noAllow"), - accessKey: gNavigatorBundle.getString("flashActivate.noAllow.accesskey"), - dismiss: true, - }]; + }, + label: gNavigatorBundle.getString("flashActivate.noAllow"), + accessKey: gNavigatorBundle.getString("flashActivate.noAllow.accesskey"), + dismiss: true, + }]; + } PopupNotifications.show(browser, "click-to-play-plugins", description, "plugins-notification-icon", diff --git a/browser/base/content/test/plugins/browser_private_clicktoplay.js b/browser/base/content/test/plugins/browser_private_clicktoplay.js index 272b09b7b230..7387bd84c950 100644 --- a/browser/base/content/test/plugins/browser_private_clicktoplay.js +++ b/browser/base/content/test/plugins/browser_private_clicktoplay.js @@ -125,8 +125,8 @@ add_task(async function test2c() { "Shown"); popupNotification.reshow(); await promiseShown; - is(gPrivateWindow.PopupNotifications.panel.firstElementChild.secondaryButton.hidden, false, - "Test 2c, Activated plugin in a private window should have visible 'Block' button."); + is(gPrivateWindow.PopupNotifications.panel.firstElementChild.secondaryButton.hidden, true, + "Test 2c, Activated plugin in a private window should not have visible 'Block' button."); is(gPrivateWindow.PopupNotifications.panel.firstElementChild.checkbox.hidden, true, "Test 2c, Activated plugin in a private window should not have visible 'Remember' checkbox.");