summaryrefslogtreecommitdiffstats
path: root/application/basilisk/components
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-03-29 16:04:01 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-03-29 16:04:01 +0100
commit88083f8c683c18f4de68a20c863a82a9da65db8f (patch)
tree926656892d9d80260da02ea8ea71031b140c51df /application/basilisk/components
parentf999f544aad04069b03704d994a99352263f600b (diff)
parent843e4ceffd6ce21a6e6db37419335eafdc543e18 (diff)
downloadUXP-88083f8c683c18f4de68a20c863a82a9da65db8f.tar
UXP-88083f8c683c18f4de68a20c863a82a9da65db8f.tar.gz
UXP-88083f8c683c18f4de68a20c863a82a9da65db8f.tar.lz
UXP-88083f8c683c18f4de68a20c863a82a9da65db8f.tar.xz
UXP-88083f8c683c18f4de68a20c863a82a9da65db8f.zip
Merge branch 'master' into Sync-weave
Diffstat (limited to 'application/basilisk/components')
-rw-r--r--application/basilisk/components/contextualidentity/content/usercontext.css91
-rw-r--r--application/basilisk/components/contextualidentity/jar.mn6
-rw-r--r--application/basilisk/components/contextualidentity/moz.build7
-rw-r--r--application/basilisk/components/customizableui/CustomizableWidgets.jsm85
-rw-r--r--application/basilisk/components/moz.build1
-rw-r--r--application/basilisk/components/preferences/containers.js176
-rw-r--r--application/basilisk/components/preferences/containers.xul52
-rw-r--r--application/basilisk/components/preferences/cookies.js39
-rw-r--r--application/basilisk/components/preferences/cookies.xul4
-rw-r--r--application/basilisk/components/preferences/handlers.css4
-rw-r--r--application/basilisk/components/preferences/handlers.xml23
-rw-r--r--application/basilisk/components/preferences/in-content/containers.js73
-rw-r--r--application/basilisk/components/preferences/in-content/containers.xul54
-rw-r--r--application/basilisk/components/preferences/in-content/jar.mn1
-rw-r--r--application/basilisk/components/preferences/in-content/preferences.js1
-rw-r--r--application/basilisk/components/preferences/in-content/preferences.xul11
-rw-r--r--application/basilisk/components/preferences/in-content/privacy.js88
-rw-r--r--application/basilisk/components/preferences/in-content/privacy.xul25
-rw-r--r--application/basilisk/components/preferences/jar.mn2
-rw-r--r--application/basilisk/components/sessionstore/ContentRestore.jsm4
-rw-r--r--application/basilisk/components/sessionstore/SessionHistory.jsm3
-rw-r--r--application/basilisk/components/sessionstore/SessionStore.jsm42
-rw-r--r--application/basilisk/components/sessionstore/TabState.jsm4
23 files changed, 14 insertions, 782 deletions
diff --git a/application/basilisk/components/contextualidentity/content/usercontext.css b/application/basilisk/components/contextualidentity/content/usercontext.css
deleted file mode 100644
index 728275d9f..000000000
--- a/application/basilisk/components/contextualidentity/content/usercontext.css
+++ /dev/null
@@ -1,91 +0,0 @@
-[data-identity-color="blue"] {
- --identity-tab-color: #0996f8;
- --identity-icon-color: #00a7e0;
-}
-
-[data-identity-color="turquoise"] {
- --identity-tab-color: #01bdad;
- --identity-icon-color: #01bdad;
-}
-
-[data-identity-color="green"] {
- --identity-tab-color: #57bd35;
- --identity-icon-color: #7dc14c;
-}
-
-[data-identity-color="yellow"] {
- --identity-tab-color: #ffcb00;
- --identity-icon-color: #ffcb00;
-}
-
-[data-identity-color="orange"] {
- --identity-tab-color: #ff9216;
- --identity-icon-color: #ff9216;
-}
-
-[data-identity-color="red"] {
- --identity-tab-color: #d92215;
- --identity-icon-color: #d92215;
-}
-
-[data-identity-color="pink"] {
- --identity-tab-color: #ea385e;
- --identity-icon-color: #ee5195;
-}
-
-[data-identity-color="purple"] {
- --identity-tab-color: #7a2f7a;
- --identity-icon-color: #7a2f7a;
-}
-
-[data-identity-icon="fingerprint"] {
- --identity-icon: url("chrome://browser/content/usercontext.svg#fingerprint");
-}
-
-[data-identity-icon="briefcase"] {
- --identity-icon: url("chrome://browser/content/usercontext.svg#briefcase");
-}
-
-[data-identity-icon="dollar"] {
- --identity-icon: url("chrome://browser/content/usercontext.svg#dollar");
-}
-
-[data-identity-icon="cart"] {
- --identity-icon: url("chrome://browser/content/usercontext.svg#cart");
-}
-
-[data-identity-icon="circle"] {
- --identity-icon: url("chrome://browser/content/usercontext.svg#circle");
-}
-
-#userContext-indicator {
- height: 16px;
- width: 16px;
-}
-
-#userContext-label {
- margin-inline-end: 3px;
- color: var(--identity-tab-color);
-}
-
-#userContext-icons {
- -moz-box-align: center;
-}
-
-.tabbrowser-tab[usercontextid] {
- background-image: linear-gradient(to right, transparent 20%, var(--identity-tab-color) 30%, var(--identity-tab-color) 70%, transparent 80%);
- background-size: auto 2px;
- background-repeat: no-repeat;
-}
-
-.userContext-icon,
-.menuitem-iconic[data-usercontextid] > .menu-iconic-left > .menu-iconic-icon,
-.subviewbutton[usercontextid] > .toolbarbutton-icon,
-#userContext-indicator {
- background-image: var(--identity-icon);
- filter: url(chrome://browser/skin/filters.svg#fill);
- fill: var(--identity-icon-color);
- background-size: contain;
- background-repeat: no-repeat;
- background-position: center center;
-}
diff --git a/application/basilisk/components/contextualidentity/jar.mn b/application/basilisk/components/contextualidentity/jar.mn
deleted file mode 100644
index 848245949..000000000
--- a/application/basilisk/components/contextualidentity/jar.mn
+++ /dev/null
@@ -1,6 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-browser.jar:
- content/browser/usercontext/usercontext.css (content/usercontext.css)
diff --git a/application/basilisk/components/contextualidentity/moz.build b/application/basilisk/components/contextualidentity/moz.build
deleted file mode 100644
index aac3a838c..000000000
--- a/application/basilisk/components/contextualidentity/moz.build
+++ /dev/null
@@ -1,7 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-JAR_MANIFESTS += ['jar.mn']
diff --git a/application/basilisk/components/customizableui/CustomizableWidgets.jsm b/application/basilisk/components/customizableui/CustomizableWidgets.jsm
index 09b3f167e..401b7ca74 100644
--- a/application/basilisk/components/customizableui/CustomizableWidgets.jsm
+++ b/application/basilisk/components/customizableui/CustomizableWidgets.jsm
@@ -23,8 +23,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "CharsetMenu",
"resource://gre/modules/CharsetMenu.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
"resource://gre/modules/PrivateBrowsingUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "ContextualIdentityService",
- "resource://gre/modules/ContextualIdentityService.jsm");
XPCOMUtils.defineLazyGetter(this, "CharsetBundle", function() {
const kCharsetBundle = "chrome://global/locale/charsetMenu.properties";
@@ -977,89 +975,6 @@ const CustomizableWidgets = [
let win = aEvent.view;
win.MailIntegration.sendLinkForBrowser(win.gBrowser.selectedBrowser)
}
- }, {
- id: "containers-panelmenu",
- type: "view",
- viewId: "PanelUI-containers",
- hasObserver: false,
- onCreated: function(aNode) {
- let doc = aNode.ownerDocument;
- let win = doc.defaultView;
- let items = doc.getElementById("PanelUI-containersItems");
-
- let onItemCommand = function (aEvent) {
- let item = aEvent.target;
- if (item.hasAttribute("usercontextid")) {
- let userContextId = parseInt(item.getAttribute("usercontextid"));
- win.openUILinkIn(win.BROWSER_NEW_TAB_URL, "tab", {userContextId});
- }
- };
- items.addEventListener("command", onItemCommand);
-
- if (PrivateBrowsingUtils.isWindowPrivate(win)) {
- aNode.setAttribute("disabled", "true");
- }
-
- this.updateVisibility(aNode);
-
- if (!this.hasObserver) {
- Services.prefs.addObserver("privacy.userContext.enabled", this, true);
- this.hasObserver = true;
- }
- },
- onViewShowing: function(aEvent) {
- let doc = aEvent.target.ownerDocument;
-
- let items = doc.getElementById("PanelUI-containersItems");
-
- while (items.firstChild) {
- items.firstChild.remove();
- }
-
- let fragment = doc.createDocumentFragment();
- let bundle = doc.getElementById("bundle_browser");
-
- ContextualIdentityService.getIdentities().forEach(identity => {
- let label = ContextualIdentityService.getUserContextLabel(identity.userContextId);
-
- let item = doc.createElementNS(kNSXUL, "toolbarbutton");
- item.setAttribute("label", label);
- item.setAttribute("usercontextid", identity.userContextId);
- item.setAttribute("class", "subviewbutton");
- item.setAttribute("data-identity-color", identity.color);
- item.setAttribute("data-identity-icon", identity.icon);
-
- fragment.appendChild(item);
- });
-
- fragment.appendChild(doc.createElementNS(kNSXUL, "menuseparator"));
-
- let item = doc.createElementNS(kNSXUL, "toolbarbutton");
- item.setAttribute("label", bundle.getString("userContext.aboutPage.label"));
- item.setAttribute("command", "Browser:OpenAboutContainers");
- item.setAttribute("class", "subviewbutton");
- fragment.appendChild(item);
-
- items.appendChild(fragment);
- },
-
- updateVisibility(aNode) {
- aNode.hidden = !Services.prefs.getBoolPref("privacy.userContext.enabled");
- },
-
- observe(aSubject, aTopic, aData) {
- let {instances} = CustomizableUI.getWidget("containers-panelmenu");
- for (let {node} of instances) {
- if (node) {
- this.updateVisibility(node);
- }
- }
- },
-
- QueryInterface: XPCOMUtils.generateQI([
- Ci.nsISupportsWeakReference,
- Ci.nsIObserver
- ]),
}];
let preferencesButton = {
diff --git a/application/basilisk/components/moz.build b/application/basilisk/components/moz.build
index a7685cbfc..65e8beb76 100644
--- a/application/basilisk/components/moz.build
+++ b/application/basilisk/components/moz.build
@@ -6,7 +6,6 @@
DIRS += [
'about',
- 'contextualidentity',
'customizableui',
'dirprovider',
'downloads',
diff --git a/application/basilisk/components/preferences/containers.js b/application/basilisk/components/preferences/containers.js
deleted file mode 100644
index 6ca5853f7..000000000
--- a/application/basilisk/components/preferences/containers.js
+++ /dev/null
@@ -1,176 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-Components.utils.import("resource://gre/modules/Services.jsm");
-Components.utils.import("resource://gre/modules/ContextualIdentityService.jsm");
-
-const containersBundle = Services.strings.createBundle("chrome://browser/locale/preferences/containers.properties");
-
-const HTMLNS = "http://www.w3.org/1999/xhtml";
-
-let gContainersManager = {
- icons: [
- "fingerprint",
- "briefcase",
- "dollar",
- "cart",
- "circle"
- ],
-
- colors: [
- "blue",
- "turquoise",
- "green",
- "yellow",
- "orange",
- "red",
- "pink",
- "purple"
- ],
-
- onLoad() {
- let params = window.arguments[0] || {};
- this.init(params);
- },
-
- init(aParams) {
- this.userContextId = aParams.userContextId || null;
- this.identity = aParams.identity;
-
- if (aParams.windowTitle) {
- document.title = aParams.windowTitle;
- }
-
- const iconWrapper = document.getElementById("iconWrapper");
- iconWrapper.appendChild(this.createIconButtons());
-
- const colorWrapper = document.getElementById("colorWrapper");
- colorWrapper.appendChild(this.createColorSwatches());
-
- if (this.identity.name) {
- const name = document.getElementById("name");
- name.value = this.identity.name;
- this.checkForm();
- }
-
- this.setLabelsMinWidth();
-
- // This is to prevent layout jank caused by the svgs and outlines rendering at different times
- document.getElementById("containers-content").removeAttribute("hidden");
- },
-
- setLabelsMinWidth() {
- const labelMinWidth = containersBundle.GetStringFromName("containers.labelMinWidth");
- const labels = [
- document.getElementById("nameLabel"),
- document.getElementById("iconLabel"),
- document.getElementById("colorLabel")
- ];
- for (let label of labels) {
- label.style.minWidth = labelMinWidth;
- }
- },
-
- uninit() {
- },
-
- // Check if name string as to if the form can be submitted
- checkForm() {
- const name = document.getElementById("name");
- let btnApplyChanges = document.getElementById("btnApplyChanges");
- if (!name.value) {
- btnApplyChanges.setAttribute("disabled", true);
- } else {
- btnApplyChanges.removeAttribute("disabled");
- }
- },
-
- createIconButtons(defaultIcon) {
- let radiogroup = document.createElement("radiogroup");
- radiogroup.setAttribute("id", "icon");
- radiogroup.className = "icon-buttons";
-
- for (let icon of this.icons) {
- let iconSwatch = document.createElement("radio");
- iconSwatch.id = "iconbutton-" + icon;
- iconSwatch.name = "icon";
- iconSwatch.type = "radio";
- iconSwatch.value = icon;
-
- if (this.identity.icon && this.identity.icon == icon) {
- iconSwatch.setAttribute("selected", true);
- }
-
- iconSwatch.setAttribute("label",
- containersBundle.GetStringFromName(`containers.${icon}.label`));
- let iconElement = document.createElement("hbox");
- iconElement.className = 'userContext-icon';
- iconElement.setAttribute("data-identity-icon", icon);
-
- iconSwatch.appendChild(iconElement);
- radiogroup.appendChild(iconSwatch);
- }
-
- return radiogroup;
- },
-
- createColorSwatches(defaultColor) {
- let radiogroup = document.createElement("radiogroup");
- radiogroup.setAttribute("id", "color");
-
- for (let color of this.colors) {
- let colorSwatch = document.createElement("radio");
- colorSwatch.id = "colorswatch-" + color;
- colorSwatch.name = "color";
- colorSwatch.type = "radio";
- colorSwatch.value = color;
-
- if (this.identity.color && this.identity.color == color) {
- colorSwatch.setAttribute("selected", true);
- }
-
- colorSwatch.setAttribute("label",
- containersBundle.GetStringFromName(`containers.${color}.label`));
- let iconElement = document.createElement("hbox");
- iconElement.className = 'userContext-icon';
- iconElement.setAttribute("data-identity-icon", "circle");
- iconElement.setAttribute("data-identity-color", color);
-
- colorSwatch.appendChild(iconElement);
- radiogroup.appendChild(colorSwatch);
- }
- return radiogroup;
- },
-
- onApplyChanges() {
- let icon = document.getElementById("icon").value;
- let color = document.getElementById("color").value;
- let name = document.getElementById("name").value;
-
- if (this.icons.indexOf(icon) == -1) {
- throw "Internal error. The icon value doesn't match.";
- }
-
- if (this.colors.indexOf(color) == -1) {
- throw "Internal error. The color value doesn't match.";
- }
-
- if (this.userContextId) {
- ContextualIdentityService.update(this.userContextId,
- name,
- icon,
- color);
- } else {
- ContextualIdentityService.create(name,
- icon,
- color);
- }
- window.parent.location.reload()
- },
-
- onWindowKeyPress(aEvent) {
- if (aEvent.keyCode == KeyEvent.DOM_VK_ESCAPE)
- window.close();
- }
-}
diff --git a/application/basilisk/components/preferences/containers.xul b/application/basilisk/components/preferences/containers.xul
deleted file mode 100644
index 62a775fe4..000000000
--- a/application/basilisk/components/preferences/containers.xul
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://browser/skin/preferences/containers.css" type="text/css"?>
-
-<!DOCTYPE dialog SYSTEM "chrome://browser/locale/preferences/containers.dtd" >
-
-<window id="ContainersDialog" class="windowDialog"
- windowtype="Browser:Permissions"
- title="&window.title;"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- style="width: &window.width;;"
- onload="gContainersManager.onLoad();"
- onunload="gContainersManager.uninit();"
- persist="screenX screenY width height"
- onkeypress="gContainersManager.onWindowKeyPress(event);">
-
- <script src="chrome://global/content/treeUtils.js"/>
- <script src="chrome://browser/content/preferences/containers.js"/>
-
- <stringbundle id="bundlePreferences"
- src="chrome://browser/locale/preferences/preferences.properties"/>
-
- <keyset>
- <key key="&windowClose.key;" modifiers="accel" oncommand="window.close();"/>
- </keyset>
-
- <vbox class="contentPane largeDialogContainer" flex="1" hidden="true" id="containers-content">
- <description id="permissionsText" control="url"/>
- <separator class="thin"/>
- <hbox align="start">
- <label id="nameLabel" control="url" value="&name.label;" accesskey="&name.accesskey;"/>
- <textbox id="name" flex="1" onkeyup="gContainersManager.checkForm();" />
- </hbox>
- <hbox align="center" id="iconWrapper">
- <label id="iconLabel" control="url" value="&icon.label;" accesskey="&icon.accesskey;"/>
- </hbox>
- <hbox align="center" id="colorWrapper">
- <label id="colorLabel" control="url" value="&color.label;" accesskey="&color.accesskey;"/>
- </hbox>
- </vbox>
- <vbox>
- <hbox class="actionButtons" align="right" flex="1">
- <button id="btnApplyChanges" disabled="true" oncommand="gContainersManager.onApplyChanges();" icon="save"
- label="&button.ok.label;" accesskey="&button.ok.accesskey;"/>
- </hbox>
- </vbox>
-</window>
diff --git a/application/basilisk/components/preferences/cookies.js b/application/basilisk/components/preferences/cookies.js
index c420855f8..4ede5b6e6 100644
--- a/application/basilisk/components/preferences/cookies.js
+++ b/application/basilisk/components/preferences/cookies.js
@@ -7,12 +7,8 @@ const nsICookie = Components.interfaces.nsICookie;
Components.utils.import("resource://gre/modules/AppConstants.jsm");
Components.utils.import("resource://gre/modules/PluralForm.jsm");
-Components.utils.import("resource://gre/modules/Services.jsm")
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "ContextualIdentityService",
- "resource://gre/modules/ContextualIdentityService.jsm");
-
var gCookiesWindow = {
_cm : Components.classes["@mozilla.org/cookiemanager;1"]
.getService(Components.interfaces.nsICookieManager),
@@ -38,10 +34,6 @@ var gCookiesWindow = {
this._populateList(true);
document.getElementById("filter").focus();
-
- if (!Services.prefs.getBoolPref("privacy.userContext.enabled")) {
- document.getElementById("userContextRow").hidden = true;
- }
},
uninit: function () {
@@ -82,24 +74,11 @@ var gCookiesWindow = {
aCookieB.originAttributes);
},
- _isPrivateCookie: function (aCookie) {
- let { userContextId } = aCookie.originAttributes;
- if (!userContextId) {
- // Default identity is public.
- return false;
- }
- return !ContextualIdentityService.getIdentityFromId(userContextId).public;
- },
-
observe: function (aCookie, aTopic, aData) {
if (aTopic != "cookie-changed")
return;
if (aCookie instanceof Components.interfaces.nsICookie) {
- if (this._isPrivateCookie(aCookie)) {
- return;
- }
-
var strippedHost = this._makeStrippedHost(aCookie.host);
if (aData == "changed")
this._handleCookieChanged(aCookie, strippedHost);
@@ -498,9 +477,6 @@ var gCookiesWindow = {
while (e.hasMoreElements()) {
var cookie = e.getNext();
if (cookie && cookie instanceof Components.interfaces.nsICookie) {
- if (this._isPrivateCookie(cookie)) {
- continue;
- }
var strippedHost = this._makeStrippedHost(cookie.host);
this._addCookie(strippedHost, cookie, hostCount);
@@ -524,17 +500,9 @@ var gCookiesWindow = {
return this._bundle.getString("expireAtEndOfSession");
},
- _getUserContextString: function(aUserContextId) {
- if (parseInt(aUserContextId) == 0) {
- return this._bundle.getString("defaultUserContextLabel");
- }
-
- return ContextualIdentityService.getUserContextLabel(aUserContextId);
- },
-
_updateCookieData: function (aItem) {
var seln = this._view.selection;
- var ids = ["name", "value", "host", "path", "isSecure", "expires", "userContext"];
+ var ids = ["name", "value", "host", "path", "isSecure", "expires"];
var properties;
if (aItem && !aItem.container && seln.count > 0) {
@@ -543,8 +511,7 @@ var gCookiesWindow = {
isDomain: aItem.isDomain ? this._bundle.getString("domainColon")
: this._bundle.getString("hostColon"),
isSecure: aItem.isSecure ? this._bundle.getString("forSecureOnly")
- : this._bundle.getString("forAnyConnection"),
- userContext: this._getUserContextString(aItem.originAttributes.userContextId) };
+ : this._bundle.getString("forAnyConnection") };
for (let id of ids) {
document.getElementById(id).disabled = false;
}
@@ -553,7 +520,7 @@ var gCookiesWindow = {
var noneSelected = this._bundle.getString("noCookieSelected");
properties = { name: noneSelected, value: noneSelected, host: noneSelected,
path: noneSelected, expires: noneSelected,
- isSecure: noneSelected, userContext: noneSelected };
+ isSecure: noneSelected };
for (let id of ids) {
document.getElementById(id).disabled = true;
}
diff --git a/application/basilisk/components/preferences/cookies.xul b/application/basilisk/components/preferences/cookies.xul
index bd60d9346..d5fefdef7 100644
--- a/application/basilisk/components/preferences/cookies.xul
+++ b/application/basilisk/components/preferences/cookies.xul
@@ -85,10 +85,6 @@
<hbox pack="end"><label id="expiresLabel" control="expires" value="&props.expires.label;"/></hbox>
<textbox id="expires" readonly="true" class="plain"/>
</row>
- <row align="center" id="userContextRow">
- <hbox pack="end"><label id="userContextLabel" control="userContext" value="&props.container.label;"/></hbox>
- <textbox id="userContext" readonly="true" class="plain"/>
- </row>
</rows>
</grid>
</hbox>
diff --git a/application/basilisk/components/preferences/handlers.css b/application/basilisk/components/preferences/handlers.css
index 6af75a08b..d5f100831 100644
--- a/application/basilisk/components/preferences/handlers.css
+++ b/application/basilisk/components/preferences/handlers.css
@@ -10,10 +10,6 @@
-moz-binding: url("chrome://browser/content/preferences/handlers.xml#handler-selected");
}
-#containersView > richlistitem {
- -moz-binding: url("chrome://browser/content/preferences/handlers.xml#container");
-}
-
/**
* Make the icons appear.
* Note: we display the icon box for every item whether or not it has an icon
diff --git a/application/basilisk/components/preferences/handlers.xml b/application/basilisk/components/preferences/handlers.xml
index 0c629d759..ad07a493c 100644
--- a/application/basilisk/components/preferences/handlers.xml
+++ b/application/basilisk/components/preferences/handlers.xml
@@ -69,29 +69,6 @@
</binding>
- <binding id="container">
- <content>
- <xul:hbox flex="1" equalsize="always">
- <xul:hbox flex="1" align="center">
- <xul:hbox xbl:inherits="data-identity-icon=containerIcon,data-identity-color=containerColor" height="24" width="24" class="userContext-icon"/>
- <xul:label flex="1" crop="end" xbl:inherits="value=containerName"/>
- </xul:hbox>
- <xul:hbox flex="1" align="right">
- <xul:button anonid="preferencesButton"
- xbl:inherits="value=userContextId"
- onclick="gContainersPane.onPeferenceClick(event.originalTarget)">
- Preferences
- </xul:button>
- <xul:button anonid="removeButton"
- xbl:inherits="value=userContextId"
- onclick="gContainersPane.onRemoveClick(event.originalTarget)">
- Remove
- </xul:button>
- </xul:hbox>
- </xul:hbox>
- </content>
- </binding>
-
<binding id="offlineapp"
extends="chrome://global/content/bindings/listbox.xml#listitem">
<content>
diff --git a/application/basilisk/components/preferences/in-content/containers.js b/application/basilisk/components/preferences/in-content/containers.js
deleted file mode 100644
index 758e45fff..000000000
--- a/application/basilisk/components/preferences/in-content/containers.js
+++ /dev/null
@@ -1,73 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-Components.utils.import("resource://gre/modules/AppConstants.jsm");
-Components.utils.import("resource://gre/modules/ContextualIdentityService.jsm");
-
-const containersBundle = Services.strings.createBundle("chrome://browser/locale/preferences/containers.properties");
-
-const defaultContainerIcon = "fingerprint";
-const defaultContainerColor = "blue";
-
-let gContainersPane = {
-
- init() {
- this._list = document.getElementById("containersView");
-
- document.getElementById("backContainersLink").addEventListener("click", function () {
- gotoPref("privacy");
- });
-
- this._rebuildView();
- },
-
- _rebuildView() {
- const containers = ContextualIdentityService.getIdentities();
- while (this._list.firstChild) {
- this._list.firstChild.remove();
- }
- for (let container of containers) {
- let item = document.createElement("richlistitem");
- item.setAttribute("containerName", ContextualIdentityService.getUserContextLabel(container.userContextId));
- item.setAttribute("containerIcon", container.icon);
- item.setAttribute("containerColor", container.color);
- item.setAttribute("userContextId", container.userContextId);
-
- this._list.appendChild(item);
- }
- },
-
- onRemoveClick(button) {
- let userContextId = button.getAttribute("value");
- ContextualIdentityService.remove(userContextId);
- this._rebuildView();
- },
- onPeferenceClick(button) {
- this.openPreferenceDialog(button.getAttribute("value"));
- },
-
- onAddButtonClick(button) {
- this.openPreferenceDialog(null);
- },
-
- openPreferenceDialog(userContextId) {
- let identity = {
- name: "",
- icon: defaultContainerIcon,
- color: defaultContainerColor
- };
- let title;
- if (userContextId) {
- identity = ContextualIdentityService.getIdentityFromId(userContextId);
- // This is required to get the translation string from defaults
- identity.name = ContextualIdentityService.getUserContextLabel(identity.userContextId);
- title = containersBundle.formatStringFromName("containers.updateContainerTitle", [identity.name], 1);
- }
-
- const params = { userContextId, identity, windowTitle: title };
- gSubDialog.open("chrome://browser/content/preferences/containers.xul",
- null, params);
- }
-
-};
diff --git a/application/basilisk/components/preferences/in-content/containers.xul b/application/basilisk/components/preferences/in-content/containers.xul
deleted file mode 100644
index e83bac1c3..000000000
--- a/application/basilisk/components/preferences/in-content/containers.xul
+++ /dev/null
@@ -1,54 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-<!-- Containers panel -->
-
-<script type="application/javascript"
- src="chrome://browser/content/preferences/in-content/containers.js"/>
-
-<preferences id="containerPreferences" hidden="true" data-category="paneContainer">
- <!-- Containers -->
- <preference id="privacy.userContext.enabled"
- name="privacy.userContext.enabled"
- type="bool"/>
-
-</preferences>
-
-<hbox hidden="true"
- class="container-header-links"
- data-category="paneContainers">
- <label class="text-link" id="backContainersLink" value="&backLink.label;" />
-</hbox>
-
-<hbox id="header-containers"
- class="header"
- hidden="true"
- data-category="paneContainers">
- <label class="header-name" flex="1">&paneContainers.title;</label>
- <button class="help-button"
- aria-label="&helpButton.label;"/>
-</hbox>
-
-<!-- Containers -->
-<groupbox id="browserContainersGroup" data-category="paneContainers" hidden="true">
- <vbox id="browserContainersbox">
-
- <richlistbox id="containersView" orient="vertical" persist="lastSelectedType"
- flex="1">
- <listheader equalsize="always">
- <treecol id="typeColumn" label="&label.label;" value="type"
- persist="sortDirection"
- flex="1" sortDirection="ascending"/>
- <treecol id="actionColumn" value="action"
- persist="sortDirection"
- flex="1"/>
- </listheader>
- </richlistbox>
- </vbox>
- <vbox>
- <hbox flex="1">
- <button onclick="gContainersPane.onAddButtonClick();" accesskey="&addButton.accesskey;" label="&addButton.label;"/>
- </hbox>
- </vbox>
-</groupbox>
diff --git a/application/basilisk/components/preferences/in-content/jar.mn b/application/basilisk/components/preferences/in-content/jar.mn
index e61a88856..70544f332 100644
--- a/application/basilisk/components/preferences/in-content/jar.mn
+++ b/application/basilisk/components/preferences/in-content/jar.mn
@@ -9,7 +9,6 @@ browser.jar:
content/browser/preferences/in-content/main.js
* content/browser/preferences/in-content/privacy.js
- content/browser/preferences/in-content/containers.js
content/browser/preferences/in-content/advanced.js
content/browser/preferences/in-content/applications.js
* content/browser/preferences/in-content/content.js
diff --git a/application/basilisk/components/preferences/in-content/preferences.js b/application/basilisk/components/preferences/in-content/preferences.js
index e18ab4b04..35e10c58d 100644
--- a/application/basilisk/components/preferences/in-content/preferences.js
+++ b/application/basilisk/components/preferences/in-content/preferences.js
@@ -61,7 +61,6 @@ function init_all() {
register_module("paneGeneral", gMainPane);
register_module("paneSearch", gSearchPane);
register_module("panePrivacy", gPrivacyPane);
- register_module("paneContainers", gContainersPane);
register_module("paneAdvanced", gAdvancedPane);
register_module("paneApplications", gApplicationsPane);
register_module("paneContent", gContentPane);
diff --git a/application/basilisk/components/preferences/in-content/preferences.xul b/application/basilisk/components/preferences/in-content/preferences.xul
index 7ec7ef119..093516140 100644
--- a/application/basilisk/components/preferences/in-content/preferences.xul
+++ b/application/basilisk/components/preferences/in-content/preferences.xul
@@ -13,7 +13,6 @@
href="chrome://browser/content/preferences/handlers.css"?>
<?xml-stylesheet href="chrome://browser/skin/preferences/applications.css"?>
<?xml-stylesheet href="chrome://browser/skin/preferences/in-content/search.css"?>
-<?xml-stylesheet href="chrome://browser/skin/preferences/in-content/containers.css"?>
<!DOCTYPE page [
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
@@ -27,8 +26,6 @@
<!ENTITY % syncDTD SYSTEM "chrome://browser/locale/preferences/sync.dtd">
<!ENTITY % securityDTD SYSTEM
"chrome://browser/locale/preferences/security.dtd">
-<!ENTITY % containersDTD SYSTEM
- "chrome://browser/locale/preferences/containers.dtd">
<!ENTITY % sanitizeDTD SYSTEM "chrome://browser/locale/sanitize.dtd">
<!ENTITY % mainDTD SYSTEM "chrome://browser/locale/preferences/main.dtd">
<!ENTITY % aboutHomeDTD SYSTEM "chrome://browser/locale/aboutHome.dtd">
@@ -46,7 +43,6 @@
%syncBrandDTD;
%syncDTD;
%securityDTD;
-%containersDTD;
%sanitizeDTD;
%mainDTD;
%aboutHomeDTD;
@@ -134,12 +130,6 @@
<label class="category-name" flex="1">&panePrivacy.title;</label>
</richlistitem>
- <richlistitem id="category-containers"
- class="category"
- value="paneContainers"
- helpTopic="prefs-containers"
- hidden="true"/>
-
<richlistitem id="category-security"
class="category"
value="paneSecurity"
@@ -183,7 +173,6 @@
#include main.xul
#include search.xul
#include privacy.xul
-#include containers.xul
#include advanced.xul
#include applications.xul
#include content.xul
diff --git a/application/basilisk/components/preferences/in-content/privacy.js b/application/basilisk/components/preferences/in-content/privacy.js
index eab606e36..a976fb4fa 100644
--- a/application/basilisk/components/preferences/in-content/privacy.js
+++ b/application/basilisk/components/preferences/in-content/privacy.js
@@ -5,8 +5,6 @@
Components.utils.import("resource://gre/modules/AppConstants.jsm");
Components.utils.import("resource://gre/modules/PluralForm.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "ContextualIdentityService",
- "resource://gre/modules/ContextualIdentityService.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
"resource://gre/modules/PluralForm.jsm");
@@ -62,59 +60,6 @@ var gPrivacyPane = {
},
/**
- * Show the Containers UI depending on the privacy.userContext.ui.enabled pref.
- */
- _initBrowserContainers: function () {
- if (!Services.prefs.getBoolPref("privacy.userContext.ui.enabled")) {
- return;
- }
-
- let link = document.getElementById("browserContainersLearnMore");
- link.href = Services.urlFormatter.formatURLPref("app.support.baseURL") + "containers";
-
- document.getElementById("browserContainersbox").hidden = false;
-
- document.getElementById("browserContainersCheckbox").checked =
- Services.prefs.getBoolPref("privacy.userContext.enabled");
- },
-
- _checkBrowserContainers: function(event) {
- let checkbox = document.getElementById("browserContainersCheckbox");
- if (checkbox.checked) {
- Services.prefs.setBoolPref("privacy.userContext.enabled", true);
- return;
- }
-
- let count = ContextualIdentityService.countContainerTabs();
- if (count == 0) {
- Services.prefs.setBoolPref("privacy.userContext.enabled", false);
- return;
- }
-
- let bundlePreferences = document.getElementById("bundlePreferences");
-
- let title = bundlePreferences.getString("disableContainersAlertTitle");
- let message = PluralForm.get(count, bundlePreferences.getString("disableContainersMsg"))
- .replace("#S", count)
- let okButton = PluralForm.get(count, bundlePreferences.getString("disableContainersOkButton"))
- .replace("#S", count)
- let cancelButton = bundlePreferences.getString("disableContainersButton2");
-
- let buttonFlags = (Ci.nsIPrompt.BUTTON_TITLE_IS_STRING * Ci.nsIPrompt.BUTTON_POS_0) +
- (Ci.nsIPrompt.BUTTON_TITLE_IS_STRING * Ci.nsIPrompt.BUTTON_POS_1);
-
- let rv = Services.prompt.confirmEx(window, title, message, buttonFlags,
- okButton, cancelButton, null, null, {});
- if (rv == 0) {
- ContextualIdentityService.closeAllContainerTabs();
- Services.prefs.setBoolPref("privacy.userContext.enabled", false);
- return;
- }
-
- checkbox.checked = true;
- },
-
- /**
* Sets up the UI for the number of days of history to keep, and updates the
* label of the "Clear Now..." button.
*/
@@ -136,7 +81,6 @@ var gPrivacyPane = {
this._initTrackingProtectionPBM();
#endif
this._initAutocomplete();
- this._initBrowserContainers();
setEventListener("privacy.sanitize.sanitizeOnShutdown", "change",
gPrivacyPane._updateSanitizeSettingsButton);
@@ -184,10 +128,6 @@ var gPrivacyPane = {
setEventListener("changeBlockListPBM", "command",
gPrivacyPane.showBlockLists);
#endif
- setEventListener("browserContainersCheckbox", "command",
- gPrivacyPane._checkBrowserContainers);
- setEventListener("browserContainersSettings", "command",
- gPrivacyPane.showContainerSettings);
},
#ifdef MOZ_SAFE_BROWSING
@@ -489,13 +429,6 @@ var gPrivacyPane = {
},
#endif
- /**
- * Displays container panel for customising and adding containers.
- */
- showContainerSettings() {
- gotoPref("containers");
- },
-
#ifdef MOZ_SAFE_BROWSING
/**
* Displays the available block lists for tracking protection.
@@ -702,25 +635,4 @@ var gPrivacyPane = {
settingsButton.disabled = !sanitizeOnShutdownPref.value;
},
-
- // CONTAINERS
-
- /*
- * preferences:
- *
- * privacy.userContext.enabled
- * - true if containers is enabled
- */
-
- /**
- * Enables/disables the Settings button used to configure containers
- */
- readBrowserContainersCheckbox: function ()
- {
- var pref = document.getElementById("privacy.userContext.enabled");
- var settings = document.getElementById("browserContainersSettings");
-
- settings.disabled = !pref.value;
- }
-
};
diff --git a/application/basilisk/components/preferences/in-content/privacy.xul b/application/basilisk/components/preferences/in-content/privacy.xul
index e6cdc5dd2..691cd6bf9 100644
--- a/application/basilisk/components/preferences/in-content/privacy.xul
+++ b/application/basilisk/components/preferences/in-content/privacy.xul
@@ -302,28 +302,3 @@
&suggestionSettings.label;
</label>
</groupbox>
-
-<!-- Containers -->
-<groupbox id="browserContainersGroup" data-category="panePrivacy" hidden="true">
- <vbox id="browserContainersbox" hidden="true">
- <caption><label>&browserContainersHeader.label;
- <label id="browserContainersLearnMore" class="text-link"
- value="&browserContainersLearnMore.label;"/>
- </label></caption>
- <hbox align="start">
- <vbox>
- <checkbox id="browserContainersCheckbox"
- label="&browserContainersEnabled.label;"
- accesskey="&browserContainersEnabled.accesskey;"
- preference="privacy.userContext.enabled"
- onsyncfrompreference="return gPrivacyPane.readBrowserContainersCheckbox();"/>
- </vbox>
- <spacer flex="1"/>
- <vbox>
- <button id="browserContainersSettings"
- label="&browserContainersSettings.label;"
- accesskey="&browserContainersSettings.accesskey;"/>
- </vbox>
- </hbox>
- </vbox>
-</groupbox>
diff --git a/application/basilisk/components/preferences/jar.mn b/application/basilisk/components/preferences/jar.mn
index 5b24e89df..f74be0820 100644
--- a/application/basilisk/components/preferences/jar.mn
+++ b/application/basilisk/components/preferences/jar.mn
@@ -24,8 +24,6 @@ browser.jar:
* content/browser/preferences/languages.xul
content/browser/preferences/languages.js
content/browser/preferences/permissions.xul
- content/browser/preferences/containers.xul
- content/browser/preferences/containers.js
content/browser/preferences/permissions.js
content/browser/preferences/sanitize.xul
content/browser/preferences/sanitize.js
diff --git a/application/basilisk/components/sessionstore/ContentRestore.jsm b/application/basilisk/components/sessionstore/ContentRestore.jsm
index d4972bcaf..8b3867624 100644
--- a/application/basilisk/components/sessionstore/ContentRestore.jsm
+++ b/application/basilisk/components/sessionstore/ContentRestore.jsm
@@ -208,10 +208,6 @@ ContentRestoreInternal.prototype = {
? Utils.deserializePrincipal(loadArguments.triggeringPrincipal)
: null;
- if (loadArguments.userContextId) {
- webNavigation.setOriginAttributesBeforeLoading({ userContextId: loadArguments.userContextId });
- }
-
webNavigation.loadURIWithOptions(loadArguments.uri, loadArguments.flags,
referrer, referrerPolicy, postData,
null, null, triggeringPrincipal);
diff --git a/application/basilisk/components/sessionstore/SessionHistory.jsm b/application/basilisk/components/sessionstore/SessionHistory.jsm
index 3d28d87db..907a60839 100644
--- a/application/basilisk/components/sessionstore/SessionHistory.jsm
+++ b/application/basilisk/components/sessionstore/SessionHistory.jsm
@@ -64,11 +64,10 @@ var SessionHistoryInternal = {
* The docShell that owns the session history.
*/
collect: function (docShell) {
- let loadContext = docShell.QueryInterface(Ci.nsILoadContext);
let webNavigation = docShell.QueryInterface(Ci.nsIWebNavigation);
let history = webNavigation.sessionHistory.QueryInterface(Ci.nsISHistoryInternal);
- let data = {entries: [], userContextId: loadContext.originAttributes.userContextId };
+ let data = {entries: []};
if (history && history.count > 0) {
// Loop over the transaction linked list directly so we can get the
diff --git a/application/basilisk/components/sessionstore/SessionStore.jsm b/application/basilisk/components/sessionstore/SessionStore.jsm
index b599bc162..086bb914a 100644
--- a/application/basilisk/components/sessionstore/SessionStore.jsm
+++ b/application/basilisk/components/sessionstore/SessionStore.jsm
@@ -2204,10 +2204,9 @@ var SessionStoreInternal = {
}
// Create a new tab.
- let userContextId = aTab.getAttribute("usercontextid");
let newTab = aTab == aWindow.gBrowser.selectedTab ?
- aWindow.gBrowser.addTab(null, {relatedToCurrent: true, ownerTab: aTab, userContextId}) :
- aWindow.gBrowser.addTab(null, {userContextId});
+ aWindow.gBrowser.addTab(null, {relatedToCurrent: true, ownerTab: aTab}) :
+ aWindow.gBrowser.addTab();
// Set tab title to "Connecting..." and start the throbber to pretend we're
// doing something while actually waiting for data from the frame script.
@@ -2296,7 +2295,7 @@ var SessionStoreInternal = {
// create a new tab
let tabbrowser = aWindow.gBrowser;
- let tab = tabbrowser.selectedTab = tabbrowser.addTab(null, state);
+ let tab = tabbrowser.selectedTab = tabbrowser.addTab();
// restore tab content
this.restoreTab(tab, state);
@@ -3100,31 +3099,13 @@ var SessionStoreInternal = {
let numVisibleTabs = 0;
for (var t = 0; t < newTabCount; t++) {
- // When trying to restore into existing tab, we also take the userContextId
- // into account if present.
- let userContextId = winData.tabs[t].userContextId;
- let reuseExisting = t < openTabCount &&
- (tabbrowser.tabs[t].getAttribute("usercontextid") == (userContextId || ""));
- // If the tab is pinned, then we'll be loading it right away, and
- // there's no need to cause a remoteness flip by loading it initially
- // non-remote.
- let forceNotRemote = !winData.tabs[t].pinned;
- let tab = reuseExisting ? tabbrowser.tabs[t] :
- tabbrowser.addTab("about:blank",
- {skipAnimation: true,
- forceNotRemote,
- userContextId,
- skipBackgroundNotify: true});
-
- // If we inserted a new tab because the userContextId didn't match with the
- // open tab, even though `t < openTabCount`, we need to remove that open tab
- // and put the newly added tab in its place.
- if (!reuseExisting && t < openTabCount) {
- tabbrowser.removeTab(tabbrowser.tabs[t]);
- tabbrowser.moveTabTo(tab, t);
- }
-
- tabs.push(tab);
+ tabs.push(t < openTabCount ?
+ tabbrowser.tabs[t] :
+ tabbrowser.addTab("about:blank", {
+ skipAnimation: true,
+ forceNotRemote: true,
+ skipBackgroundNotify: true
+ }));
if (winData.tabs[t].pinned)
tabbrowser.pinTab(tabs[t]);
@@ -3531,9 +3512,6 @@ var SessionStoreInternal = {
let uri = activePageData ? activePageData.url || null : null;
if (aLoadArguments) {
uri = aLoadArguments.uri;
- if (aLoadArguments.userContextId) {
- browser.setAttribute("usercontextid", aLoadArguments.userContextId);
- }
}
// We have to mark this tab as restoring first, otherwise
diff --git a/application/basilisk/components/sessionstore/TabState.jsm b/application/basilisk/components/sessionstore/TabState.jsm
index f22c52fe3..ac846031b 100644
--- a/application/basilisk/components/sessionstore/TabState.jsm
+++ b/application/basilisk/components/sessionstore/TabState.jsm
@@ -181,10 +181,6 @@ var TabStateInternal = {
if (key === "history") {
tabData.entries = value.entries;
- if (value.hasOwnProperty("userContextId")) {
- tabData.userContextId = value.userContextId;
- }
-
if (value.hasOwnProperty("index")) {
tabData.index = value.index;
}