Bug 1417238 - hide 'open link in container' menu when there are no containers, r=jkt

Differential Revision: https://phabricator.services.mozilla.com/D37439

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Gijs Kruitbosch 2019-07-09 16:20:06 +00:00
Родитель a48c958c4a
Коммит 9a5e853d3d
2 изменённых файлов: 6 добавлений и 4 удалений

Просмотреть файл

@ -442,9 +442,9 @@ nsContextMenu.prototype = {
var shouldShow = var shouldShow =
this.onSaveableLink || isMailtoInternal || this.onPlainTextLink; this.onSaveableLink || isMailtoInternal || this.onPlainTextLink;
var isWindowPrivate = PrivateBrowsingUtils.isWindowPrivate(window); var isWindowPrivate = PrivateBrowsingUtils.isWindowPrivate(window);
var showContainers = Services.prefs.getBoolPref( let showContainers =
"privacy.userContext.enabled" Services.prefs.getBoolPref("privacy.userContext.enabled") &&
); ContextualIdentityService.getPublicIdentities().length;
this.showItem("context-openlink", shouldShow && !isWindowPrivate); this.showItem("context-openlink", shouldShow && !isWindowPrivate);
this.showItem( this.showItem(
"context-openlinkprivate", "context-openlinkprivate",

Просмотреть файл

@ -17,7 +17,9 @@ let LOGIN_FILL_ITEMS = [
null, null,
]; ];
let hasPocket = Services.prefs.getBoolPref("extensions.pocket.enabled"); let hasPocket = Services.prefs.getBoolPref("extensions.pocket.enabled");
let hasContainers = Services.prefs.getBoolPref("privacy.userContext.enabled"); let hasContainers =
Services.prefs.getBoolPref("privacy.userContext.enabled") &&
ContextualIdentityService.getPublicIdentities().length;
const example_base = const example_base =
"http://example.com/browser/browser/base/content/test/contextMenu/"; "http://example.com/browser/browser/base/content/test/contextMenu/";