mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 16:55:40 +00:00
Bug 1558898 - show a 'block' option for plugins in private browsing, r=johannh
Differential Revision: https://phabricator.services.mozilla.com/D34899 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
16d0e92412
commit
daf8e7418a
@ -156,7 +156,7 @@ var gPluginHandler = {
|
||||
|
||||
case "block":
|
||||
permission = Ci.nsIPermissionManager.PROMPT_ACTION;
|
||||
expireType = Ci.nsIPermissionManager.EXPIRE_NEVER;
|
||||
expireType = Ci.nsIPermissionManager.EXPIRE_SESSION;
|
||||
expireTime = 0;
|
||||
histogram.add(2);
|
||||
switch (aPluginInfo.blocklistState) {
|
||||
@ -259,8 +259,6 @@ 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 = {
|
||||
@ -308,25 +306,21 @@ var gPluginHandler = {
|
||||
accessKey: gNavigatorBundle.getString("flashActivate.allow.accesskey"),
|
||||
dismiss: true,
|
||||
};
|
||||
|
||||
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");
|
||||
}
|
||||
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");
|
||||
}
|
||||
},
|
||||
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",
|
||||
|
@ -125,8 +125,8 @@ add_task(async function test2c() {
|
||||
"Shown");
|
||||
popupNotification.reshow();
|
||||
await promiseShown;
|
||||
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.secondaryButton.hidden, false,
|
||||
"Test 2c, Activated plugin in a private window should 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.");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user