diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-07-18 08:24:24 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-07-18 08:24:24 +0200 |
commit | fc61780b35af913801d72086456f493f63197da6 (patch) | |
tree | f85891288a7bd988da9f0f15ae64e5c63f00d493 /application/palemoon/components | |
parent | 69f7f9e5f1475891ce11cc4f431692f965b0cd30 (diff) | |
parent | 50d3e596bbe89c95615f96eb71f6bc5be737a1db (diff) | |
download | UXP-fc61780b35af913801d72086456f493f63197da6.tar UXP-fc61780b35af913801d72086456f493f63197da6.tar.gz UXP-fc61780b35af913801d72086456f493f63197da6.tar.lz UXP-fc61780b35af913801d72086456f493f63197da6.tar.xz UXP-fc61780b35af913801d72086456f493f63197da6.zip |
Merge commit '50d3e596bbe89c95615f96eb71f6bc5be737a1db' into Basilisk-releasev2018.07.18
# Conflicts:
# browser/app/profile/firefox.js
# browser/components/preferences/jar.mn
Diffstat (limited to 'application/palemoon/components')
20 files changed, 221 insertions, 200 deletions
diff --git a/application/palemoon/components/about/AboutRedirector.cpp b/application/palemoon/components/about/AboutRedirector.cpp index 27f6540b2..fbcad6094 100644 --- a/application/palemoon/components/about/AboutRedirector.cpp +++ b/application/palemoon/components/about/AboutRedirector.cpp @@ -53,16 +53,16 @@ static RedirEntry kRedirMap[] = { nsIAboutModule::ALLOW_SCRIPT }, { - "newtab", "chrome://browser/content/newtab/newTab.xul", + "newtab", "chrome://browser/content/newtab/newTab.xhtml", nsIAboutModule::ALLOW_SCRIPT }, { - "palemoon", "chrome://global/content/memoriam.xhtml", + "palemoon", "chrome://browser/content/palemoon.xhtml", nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | nsIAboutModule::HIDE_FROM_ABOUTABOUT }, { - "permissions", "chrome://browser/content/preferences/aboutPermissions.xul", + "permissions", "chrome://browser/content/permissions/aboutPermissions.xul", nsIAboutModule::ALLOW_SCRIPT }, { @@ -70,12 +70,7 @@ static RedirEntry kRedirMap[] = { nsIAboutModule::ALLOW_SCRIPT }, { - "rights", -#ifdef MOZ_OFFICIAL_BRANDING - "chrome://global/content/aboutRights.xhtml", -#else - "chrome://global/content/aboutRights-unbranded.xhtml", -#endif + "rights", "chrome://global/content/aboutRights.xhtml", nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | nsIAboutModule::MAKE_LINKABLE | nsIAboutModule::ALLOW_SCRIPT diff --git a/application/palemoon/components/downloads/DownloadsCommon.jsm b/application/palemoon/components/downloads/DownloadsCommon.jsm index c6614e780..bd5d55a73 100644 --- a/application/palemoon/components/downloads/DownloadsCommon.jsm +++ b/application/palemoon/components/downloads/DownloadsCommon.jsm @@ -77,8 +77,7 @@ const nsIDM = Ci.nsIDownloadManager; const kDownloadsStringBundleUrl = "chrome://browser/locale/downloads/downloads.properties"; -const kPrefBdmScanWhenDone = "browser.download.manager.scanWhenDone"; -const kPrefBdmAlertOnExeOpen = "browser.download.manager.alertOnEXEOpen"; +const kPrefConfirmOpenExe = "browser.download.confirmOpenExecutable"; const kDownloadsStringsRequiringFormatting = { sizeWithUnits: true, @@ -518,21 +517,22 @@ this.DownloadsCommon = { if (!(aOwnerWindow instanceof Ci.nsIDOMWindow)) throw new Error("aOwnerWindow must be a dom-window object"); +#ifdef XP_WIN + // On Windows, the system will provide a native confirmation prompt + // for .exe files. Exclude this from our prompt, but prompt on other + // executable types. + let isWindowsExe = aFile.leafName.toLowerCase().endsWith(".exe"); +#else + let isWindowsExe = false; +#endif + // Confirm opening executable files if required. - if (aFile.isExecutable()) { + if (aFile.isExecutable() && !isWindowsExe) { let showAlert = true; try { - showAlert = Services.prefs.getBoolPref(kPrefBdmAlertOnExeOpen); - } catch (ex) { } - - // On Vista and above, we rely on native security prompting for - // downloaded content unless it's disabled. - if (DownloadsCommon.isWinVistaOrHigher) { - try { - if (Services.prefs.getBoolPref(kPrefBdmScanWhenDone)) { - showAlert = false; - } - } catch (ex) { } + showAlert = Services.prefs.getBoolPref(kPrefConfirmOpenExe); + } catch (ex) { + // If the preference does not exist, continue with the prompt. } if (showAlert) { @@ -541,18 +541,11 @@ this.DownloadsCommon = { DownloadsCommon.strings.fileExecutableSecurityWarning(name, name); let title = DownloadsCommon.strings.fileExecutableSecurityWarningTitle; - let dontAsk = - DownloadsCommon.strings.fileExecutableSecurityWarningDontAsk; - let checkbox = { value: false }; - let open = Services.prompt.confirmCheck(aOwnerWindow, title, message, - dontAsk, checkbox); + let open = Services.prompt.confirm(aOwnerWindow, title, message); if (!open) { return; } - - Services.prefs.setBoolPref(kPrefBdmAlertOnExeOpen, - !checkbox.value); } } diff --git a/application/palemoon/components/downloads/moz.build b/application/palemoon/components/downloads/moz.build index 3bebfd6d1..61d8c0f62 100644 --- a/application/palemoon/components/downloads/moz.build +++ b/application/palemoon/components/downloads/moz.build @@ -13,7 +13,10 @@ EXTRA_COMPONENTS += [ ] EXTRA_JS_MODULES += [ - 'DownloadsCommon.jsm', 'DownloadsLogger.jsm', 'DownloadsTaskbar.jsm', -]
\ No newline at end of file +] + +EXTRA_PP_JS_MODULES += [ + 'DownloadsCommon.jsm', +] diff --git a/application/palemoon/components/moz.build b/application/palemoon/components/moz.build index 6e83936a9..397bf5142 100644 --- a/application/palemoon/components/moz.build +++ b/application/palemoon/components/moz.build @@ -12,6 +12,7 @@ DIRS += [ 'feeds', 'fuel', 'places', + 'permissions', 'preferences', 'privatebrowsing', 'search', diff --git a/application/palemoon/components/nsBrowserGlue.js b/application/palemoon/components/nsBrowserGlue.js index aa24d88ef..720d1165c 100644 --- a/application/palemoon/components/nsBrowserGlue.js +++ b/application/palemoon/components/nsBrowserGlue.js @@ -1207,7 +1207,7 @@ BrowserGlue.prototype = { }, _migrateUI: function BG__migrateUI() { - const UI_VERSION = 17; + const UI_VERSION = 19; const BROWSER_DOCURL = "chrome://browser/content/browser.xul#"; let currentUIVersion = 0; try { @@ -1412,6 +1412,36 @@ BrowserGlue.prototype = { delete this._rdf; delete this._dataSource; + if (currentUIVersion < 18) { + // Make sure the doNotTrack value conforms to the conversion from + // three-state to two-state. (This reverts a setting of "please track me" + // to the default "don't say anything"). + try { + if (Services.prefs.getBoolPref("privacy.donottrackheader.enabled") && + Services.prefs.getIntPref("privacy.donottrackheader.value") != 1) { + Services.prefs.clearUserPref("privacy.donottrackheader.enabled"); + Services.prefs.clearUserPref("privacy.donottrackheader.value"); + } + } + catch (ex) {} + } + +#ifndef MOZ_JXR + // Until JPEG-XR decoder is implemented (UXP #144) + if (currentUIVersion < 19) { + try { + let ihaPref = "image.http.accept"; + let ihaValue = Services.prefs.getCharPref(ihaPref); + if (ihaValue.includes("image/jxr,")) { + Services.prefs.setCharPref(ihaPref, ihaValue.replace("image/jxr,", "")); + } else if (ihaValue.includes("image/jxr")) { + Services.prefs.clearUserPref(ihaPref); + } + } + catch (ex) {} + } +#endif + // Update the migration version. Services.prefs.setIntPref("browser.migration.version", UI_VERSION); }, diff --git a/application/palemoon/components/preferences/aboutPermissions.css b/application/palemoon/components/permissions/aboutPermissions.css index cec82a030..d73b6a879 100644 --- a/application/palemoon/components/preferences/aboutPermissions.css +++ b/application/palemoon/components/permissions/aboutPermissions.css @@ -3,9 +3,9 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ .site { - -moz-binding: url("chrome://browser/content/preferences/aboutPermissions.xml#site"); + -moz-binding: url("chrome://browser/content/permissions/aboutPermissions.xml#site"); } .pluginPermission { - -moz-binding: url("chrome://browser/content/preferences/aboutPermissions.xml#pluginPermission"); + -moz-binding: url("chrome://browser/content/permissions/aboutPermissions.xml#pluginPermission"); } diff --git a/application/palemoon/components/preferences/aboutPermissions.js b/application/palemoon/components/permissions/aboutPermissions.js index 9fb12d081..6a02daa29 100644 --- a/application/palemoon/components/preferences/aboutPermissions.js +++ b/application/palemoon/components/permissions/aboutPermissions.js @@ -77,7 +77,7 @@ Site.prototype = { * @param aCallback * A callback function that takes a favicon image URL as a parameter. */ - getFavicon: function Site_getFavicon(aCallback) { + getFavicon: function(aCallback) { function invokeCallback(aFaviconURI) { try { // Use getFaviconLinkForIcon to get image data from the database instead @@ -102,7 +102,7 @@ Site.prototype = { * @param aCallback * A function that takes the visit count (a number) as a parameter. */ - getVisitCount: function Site_getVisitCount(aCallback) { + getVisitCount: function(aCallback) { // XXX This won't be a very reliable system, as it will count both http: and https: visits // Unfortunately, I don't think that there is a much better way to do it right now. let rev_host = this.principal.URI.host.split("").reverse().join("") + "."; @@ -130,13 +130,13 @@ Site.prototype = { * * @param aType * The permission type string stored in permission manager. - * e.g. "cookie", "geo", "indexedDB", "popup", "image" + * e.g. "cookie", "geo", "popup", "image" * @param aResultObj * An object that stores the permission value set for aType. * * @return A boolean indicating whether or not a permission is set. */ - getPermission: function Site_getPermission(aType, aResultObj) { + getPermission: function(aType, aResultObj) { // Password saving isn't a nsIPermissionManager permission type, so handle // it seperately. if (aType == "password") { @@ -169,12 +169,12 @@ Site.prototype = { * * @param aType * The permission type string stored in permission manager. - * e.g. "cookie", "geo", "indexedDB", "popup", "image" + * e.g. "cookie", "geo", "popup", "image" * @param aPerm * The permission value to set for the permission type. This should * be one of the constants defined in nsIPermissionManager. */ - setPermission: function Site_setPermission(aType, aPerm) { + setPermission: function(aType, aPerm) { // Password saving isn't a nsIPermissionManager permission type, so handle // it seperately. if (aType == "password") { @@ -196,9 +196,9 @@ Site.prototype = { * * @param aType * The permission type string stored in permission manager. - * e.g. "cookie", "geo", "indexedDB", "popup", "image" + * e.g. "cookie", "geo", "popup", "image" */ - clearPermission: function Site_clearPermission(aType) { + clearPermission: function(aType) { Services.perms.removeFromPrincipal(this.principal, aType); }, @@ -254,7 +254,7 @@ Site.prototype = { while (enumerator.hasMoreElements()) { let cookie = enumerator.getNext().QueryInterface(Ci.nsICookie2); if (cookie.host.hasRootDomain( - AboutPermissions.domainFromHost(this.host))) { + AboutPermissions.domainFromHost(this.principal.URI.host))) { cookies.push(cookie); } } @@ -264,16 +264,17 @@ Site.prototype = { /** * Removes a set of specific cookies from the browser. */ - clearCookies: function Site_clearCookies() { + clearCookies: function() { this.cookies.forEach(function(aCookie) { - Services.cookies.remove(aCookie.host, aCookie.name, aCookie.path, false); + Services.cookies.remove(aCookie.host, aCookie.name, aCookie.path, false, + aCookie.originAttributes); }); }, /** * Removes all data from the browser corresponding to the site. */ - forgetSite: function Site_forgetSite() { + forgetSite: function() { // XXX This removes data for an entire domain, rather than just // an origin. This may produce confusing results, as data will // be cleared for the http:// as well as the https:// domain @@ -404,20 +405,6 @@ var PermissionDefaults = { let value = (aValue != this.DENY); Services.prefs.setBoolPref("geo.enabled", value); }, - - get indexedDB() { - if (!Services.prefs.getBoolPref("dom.indexedDB.enabled")) { - return this.DENY; - } - // We always ask for permission to enable indexedDB storage for a specific - // site, so there is no global ALLOW. - return this.UNKNOWN; - }, - set indexedDB(aValue) { - let value = (aValue != this.DENY); - Services.prefs.setBoolPref("dom.indexedDB.enabled", value); - }, - } /** @@ -464,12 +451,12 @@ var AboutPermissions = { * Potential future additions: "sts/use", "sts/subd" */ _supportedPermissions: ["password", "image", "popup", "cookie", - "desktop-notification", "install", "geo", "indexedDB"], + "desktop-notification", "install", "geo"], /** * Permissions that don't have a global "Allow" option. */ - _noGlobalAllow: ["desktop-notification", "geo", "indexedDB"], + _noGlobalAllow: ["desktop-notification", "geo"], /** * Permissions that don't have a global "Deny" option. @@ -480,7 +467,7 @@ var AboutPermissions = { .createBundle("chrome://browser/locale/browser.properties"), _stringBundleAboutPermissions: Services.strings.createBundle( - "chrome://browser/locale/preferences/aboutPermissions.properties"), + "chrome://browser/locale/permissions/aboutPermissions.properties"), _initPart1: function() { this.initPluginList(); @@ -514,7 +501,6 @@ var AboutPermissions = { Services.prefs.addObserver("dom.webnotifications.enabled", this, false); Services.prefs.addObserver("xpinstall.whitelist.required", this, false); Services.prefs.addObserver("geo.enabled", this, false); - Services.prefs.addObserver("dom.indexedDB.enabled", this, false); Services.prefs.addObserver("plugins.click_to_play", this, false); Services.prefs.addObserver("permissions.places-sites-limit", this, false); @@ -586,13 +572,7 @@ var AboutPermissions = { permissionEntry.setAttribute("id", permString + "-entry"); // If the plugin is disabled, it makes no sense to change its // click-to-play status, so don't add it. - // If the click-to-play pref is not set and the plugin is not - // click-to-play blocklisted, again click-to-play doesn't apply, - // so don't add it. - if (plugin.disabled || - (!Services.prefs.getBoolPref("plugins.click_to_play") && - (pluginHost.getStateForType(mimeType) - != Ci.nsIPluginTag.STATE_CLICKTOPLAY))) { + if (plugin.disabled) { permissionEntry.hidden = true; } else { permissionEntry.hidden = false; @@ -602,10 +582,13 @@ var AboutPermissions = { this._noGlobalDeny.push(permString); Object.defineProperty(PermissionDefaults, permString, { get: function() { - return this.isClickToPlay() - ? PermissionDefaults.UNKNOWN - : PermissionDefaults.ALLOW; - }.bind(permissionEntry), + if ((Services.prefs.getBoolPref("plugins.click_to_play") && + plugin.clicktoplay) || + permString.startsWith("plugin-vulnerable:")) { + return PermissionDefaults.UNKNOWN; + } + return PermissionDefaults.ALLOW; + }, set: function(aValue) { this.clicktoplay = (aValue == PermissionDefaults.UNKNOWN); }.bind(plugin), @@ -664,7 +647,6 @@ var AboutPermissions = { Services.prefs.removeObserver("dom.webnotifications.enabled", this, false); Services.prefs.removeObserver("xpinstall.whitelist.required", this, false); Services.prefs.removeObserver("geo.enabled", this, false); - Services.prefs.removeObserver("dom.indexedDB.enabled", this, false); Services.prefs.removeObserver("plugins.click_to_play", this, false); Services.prefs.removeObserver("permissions.places-sites-limit", this, false); @@ -1029,7 +1011,7 @@ var AboutPermissions = { * * @param aType * The permission type string stored in permission manager. - * e.g. "cookie", "geo", "indexedDB", "popup", "image" + * e.g. "cookie", "geo", "popup", "image" */ updatePermission: function(aType) { let allowItem = document.getElementById( @@ -1066,21 +1048,24 @@ var AboutPermissions = { // which is reserved for site-specific preferences only. document.getElementById(aType + "-9").hidden = true; } else if (aType.startsWith("plugin")) { - if (!Services.prefs.getBoolPref("plugins.click_to_play")) { - // It is reserved for site-specific preferences only. - document.getElementById(aType + "-0").disabled = true; - } pluginPermissionEntry = document.getElementById(aType + "-entry"); pluginPermissionEntry.setAttribute("vulnerable", ""); + let vulnerable = false; if (pluginPermissionEntry.isBlocklisted()) { permissionMenulist.disabled = true; permissionMenulist.setAttribute("tooltiptext", AboutPermissions._stringBundleAboutPermissions .GetStringFromName("pluginBlocklisted")); + vulnerable = true; } else { permissionMenulist.disabled = false; permissionMenulist.setAttribute("tooltiptext", ""); } + if (Services.prefs.getBoolPref("plugins.click_to_play") || vulnerable) { + document.getElementById(aType + "-0").disabled = false; + } else { + document.getElementById(aType + "-0").disabled = true; + } } } else { let _visibility = "visible"; @@ -1094,14 +1079,20 @@ var AboutPermissions = { } else if (aType == "cookie") { document.getElementById(aType + "-9").hidden = false; } else if (aType.startsWith("plugin")) { - document.getElementById(aType + "-0").disabled = false; pluginPermissionEntry = document.getElementById(aType + "-entry"); let permString = pluginPermissionEntry.getAttribute("permString"); + let vulnerable = false; if (permString.startsWith("plugin-vulnerable:")) { let nameVulnerable = " \u2014 " + AboutPermissions._stringBundleBrowser .GetStringFromName("pluginActivateVulnerable.label"); pluginPermissionEntry.setAttribute("vulnerable", nameVulnerable); + vulnerable = true; + } + if (Services.prefs.getBoolPref("plugins.click_to_play") || vulnerable) { + document.getElementById(aType + "-0").disabled = false; + } else { + document.getElementById(aType + "-0").disabled = true; } permissionMenulist.disabled = false; permissionMenulist.setAttribute("tooltiptext", ""); @@ -1320,7 +1311,7 @@ var AboutPermissions = { } // See toolkit/forgetaboutsite/ForgetAboutSite.jsm -String.prototype.hasRootDomain = function hasRootDomain(aDomain) { +String.prototype.hasRootDomain = function(aDomain) { let index = this.indexOf(aDomain); if (index == -1) { return false; diff --git a/application/palemoon/components/preferences/aboutPermissions.xml b/application/palemoon/components/permissions/aboutPermissions.xml index 4df0d964d..2932ea08c 100644 --- a/application/palemoon/components/preferences/aboutPermissions.xml +++ b/application/palemoon/components/permissions/aboutPermissions.xml @@ -4,7 +4,7 @@ - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> <!DOCTYPE bindings [ -<!ENTITY % aboutPermissionsDTD SYSTEM "chrome://browser/locale/preferences/aboutPermissions.dtd" > +<!ENTITY % aboutPermissionsDTD SYSTEM "chrome://browser/locale/permissions/aboutPermissions.dtd" > %aboutPermissionsDTD; ]> diff --git a/application/palemoon/components/preferences/aboutPermissions.xul b/application/palemoon/components/permissions/aboutPermissions.xul index 56d6cfbbf..afd98247b 100644 --- a/application/palemoon/components/preferences/aboutPermissions.xul +++ b/application/palemoon/components/permissions/aboutPermissions.xul @@ -4,13 +4,13 @@ - 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/content/preferences/aboutPermissions.css"?> -<?xml-stylesheet href="chrome://browser/skin/preferences/aboutPermissions.css"?> +<?xml-stylesheet href="chrome://browser/content/permissions/aboutPermissions.css"?> +<?xml-stylesheet href="chrome://browser/skin/permissions/aboutPermissions.css"?> <!DOCTYPE page [ <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" > %brandDTD; -<!ENTITY % aboutPermissionsDTD SYSTEM "chrome://browser/locale/preferences/aboutPermissions.dtd" > +<!ENTITY % aboutPermissionsDTD SYSTEM "chrome://browser/locale/permissions/aboutPermissions.dtd" > %aboutPermissionsDTD; ]> @@ -23,7 +23,7 @@ role="application"> <script type="application/javascript" - src="chrome://browser/content/preferences/aboutPermissions.js"/> + src="chrome://browser/content/permissions/aboutPermissions.js"/> <keyset> <key key="&focusSearch.key;" modifiers="accel" oncommand="AboutPermissions.focusFilterBox();"/> @@ -298,35 +298,6 @@ </vbox> </hbox> - <!-- IndexedDB Storage --> - <hbox id="indexedDB-pref-item" - class="pref-item" align="top"> - <image class="pref-icon" type="indexedDB"/> - <vbox> - <hbox> - <label class="pref-title" value="&indexedDB.label;"/> - <label id="indexedDB-default" class="pref-default" value="*"/> - </hbox> - <hbox> - <menulist id="indexedDB-menulist" - class="pref-menulist" - type="indexedDB" - oncommand="AboutPermissions.onPermissionCommand(event, false);"> - <menupopup> - <menuitem id="indexedDB-0" value="0" label="&permission.alwaysAsk;"/> - <menuitem id="indexedDB-1" value="1" label="&permission.allow;"/> - <menuitem id="indexedDB-2" value="2" label="&permission.block;"/> - </menupopup> - </menulist> - <button id="indexedDB-set-default" - class="pref-set-default" - label="&permission.default;" - type="indexedDB" - oncommand="AboutPermissions.onPermissionCommand(event, true);"/> - </hbox> - </vbox> - </hbox> - <!-- Opt-in activation of Plug-ins --> <hbox id="plugins-pref-item" class="pref-item" align="top"> diff --git a/application/palemoon/components/permissions/jar.mn b/application/palemoon/components/permissions/jar.mn new file mode 100644 index 000000000..53fb2b41e --- /dev/null +++ b/application/palemoon/components/permissions/jar.mn @@ -0,0 +1,9 @@ +# 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/permissions/aboutPermissions.xul + content/browser/permissions/aboutPermissions.js + content/browser/permissions/aboutPermissions.css + content/browser/permissions/aboutPermissions.xml diff --git a/application/palemoon/components/permissions/moz.build b/application/palemoon/components/permissions/moz.build new file mode 100644 index 000000000..a4c26de89 --- /dev/null +++ b/application/palemoon/components/permissions/moz.build @@ -0,0 +1,8 @@ +# -*- Mode: python; c-basic-offset: 4; 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/palemoon/components/places/PlacesUIUtils.jsm b/application/palemoon/components/places/PlacesUIUtils.jsm index dd0695f78..f62535613 100644 --- a/application/palemoon/components/places/PlacesUIUtils.jsm +++ b/application/palemoon/components/places/PlacesUIUtils.jsm @@ -1136,6 +1136,33 @@ this.PlacesUIUtils = { } } return queryName; + }, + + /** + * Returns the passed URL with a #moz-resolution fragment + * for the specified dimensions and devicePixelRatio. + * + * @param aWindow + * A window from where we want to get the device + * pixel Ratio + * + * @param aURL + * The URL where we should add the fragment + * + * @param aWidth + * The target image width + * + * @param aHeight + * The target image height + * + * @return The URL with the fragment at the end + */ + getImageURLForResolution: + function PUIU_getImageURLForResolution(aWindow, aURL, aWidth = 16, aHeight = 16) { + let width = Math.round(aWidth * aWindow.devicePixelRatio); + let height = Math.round(aHeight * aWindow.devicePixelRatio); + return aURL + (aURL.includes("#") ? "&" : "#") + + "-moz-resolution=" + width + "," + height; } }; diff --git a/application/palemoon/components/places/content/browserPlacesViews.js b/application/palemoon/components/places/content/browserPlacesViews.js index 4ab80cac6..eec7274a4 100644 --- a/application/palemoon/components/places/content/browserPlacesViews.js +++ b/application/palemoon/components/places/content/browserPlacesViews.js @@ -338,7 +338,8 @@ PlacesViewBase.prototype = { let icon = aPlacesNode.icon; if (icon) - element.setAttribute("image", icon); + element.setAttribute("image", + PlacesUIUtils.getImageURLForResolution(window, icon)); } element._placesNode = aPlacesNode; @@ -464,7 +465,8 @@ PlacesViewBase.prototype = { if (!icon) elt.removeAttribute("image"); else if (icon != elt.getAttribute("image")) - elt.setAttribute("image", icon); + elt.setAttribute("image", + PlacesUIUtils.getImageURLForResolution(window, icon)); }, nodeAnnotationChanged: @@ -966,7 +968,8 @@ PlacesToolbar.prototype = { button.setAttribute("label", aChild.title || ""); let icon = aChild.icon; if (icon) - button.setAttribute("image", icon); + button.setAttribute("image", + PlacesUIUtils.getImageURLForResolution(window, icon)); if (PlacesUtils.containerTypes.indexOf(type) != -1) { button.setAttribute("type", "menu"); diff --git a/application/palemoon/components/preferences/cookies.js b/application/palemoon/components/preferences/cookies.js index 4ef30d48e..4fa47ee4e 100644 --- a/application/palemoon/components/preferences/cookies.js +++ b/application/palemoon/components/preferences/cookies.js @@ -540,6 +540,8 @@ var gCookiesWindow = { onCookieSelected: function () { var properties, item; var seln = this._tree.view.selection; + var hasRows = this._tree.view.rowCount > 0; + var hasSelection = seln.count > 0; if (!this._view._filtered) item = this._view._getItemAtIndex(seln.currentIndex); else @@ -570,7 +572,7 @@ var gCookiesWindow = { removeSelectedCookies.label = PluralForm.get(selectedCookieCount, buttonLabel) .replace("#1", selectedCookieCount); - removeSelectedCookies.disabled = !(seln.count > 0); + removeSelectedCookies.disabled = !hasRows || !hasSelection; }, performDeletion: function gCookiesWindow_performDeletion(deleteItems) { @@ -786,7 +788,9 @@ var gCookiesWindow = { this._view._invalidateCache(0); this._view.selection.clearSelection(); - this._view.selection.select(0); + if (this._view.rowCount > 0) { + this._view.selection.select(0); + } this._tree.treeBoxObject.invalidate(); this._tree.treeBoxObject.ensureRowIsVisible(0); diff --git a/application/palemoon/components/preferences/jar.mn b/application/palemoon/components/preferences/jar.mn index 798a2dae4..2e2949306 100644 --- a/application/palemoon/components/preferences/jar.mn +++ b/application/palemoon/components/preferences/jar.mn @@ -3,10 +3,6 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. browser.jar: - content/browser/preferences/aboutPermissions.xul - content/browser/preferences/aboutPermissions.js - content/browser/preferences/aboutPermissions.css - content/browser/preferences/aboutPermissions.xml * content/browser/preferences/advanced.xul * content/browser/preferences/advanced.js content/browser/preferences/applications.xul diff --git a/application/palemoon/components/preferences/privacy.js b/application/palemoon/components/preferences/privacy.js index 18e38395d..05c2f9b8a 100644 --- a/application/palemoon/components/preferences/privacy.js +++ b/application/palemoon/components/preferences/privacy.js @@ -151,42 +151,6 @@ var gPrivacyPane = { }, /** - * Update the Tracking preferences based on controls. - */ - setTrackingPrefs: function PPP_setTrackingPrefs() - { - let dntRadioGroup = document.getElementById("doNotTrackSelection"), - dntValuePref = document.getElementById("privacy.donottrackheader.value"), - dntEnabledPref = document.getElementById("privacy.donottrackheader.enabled"); - - // if the selected radio button says "no preference", set on/off pref to - // false and don't change the value pref. - if (dntRadioGroup.selectedItem.value == -1) { - dntEnabledPref.value = false; - return dntValuePref.value; - } - - dntEnabledPref.value = true; - return dntRadioGroup.selectedItem.value; - }, - - /** - * Obtain the tracking preference value and reflect it in the UI. - */ - getTrackingPrefs: function PPP_getTrackingPrefs() - { - let dntValuePref = document.getElementById("privacy.donottrackheader.value"), - dntEnabledPref = document.getElementById("privacy.donottrackheader.enabled"); - - // if DNT is enbaled, select the value from the selected radio - // button, otherwise choose the "no preference" radio button - if (dntEnabledPref.value) - return dntValuePref.value; - - return document.getElementById("dntnopref").value; - }, - - /** * Update the private browsing auto-start pref and the history mode * micro-management prefs based on the history mode menulist */ diff --git a/application/palemoon/components/preferences/privacy.xul b/application/palemoon/components/preferences/privacy.xul index 057d549a9..bdb227c63 100644 --- a/application/palemoon/components/preferences/privacy.xul +++ b/application/palemoon/components/preferences/privacy.xul @@ -30,9 +30,6 @@ <preference id="privacy.donottrackheader.enabled" name="privacy.donottrackheader.enabled" type="bool"/> - <preference id="privacy.donottrackheader.value" - name="privacy.donottrackheader.value" - type="int"/> <!-- XXX button prefs --> <preference id="pref.privacy.disable_button.cookie_exceptions" @@ -239,17 +236,11 @@ <!-- Tracking --> <tabpanel id="trackingPanel" orient="vertical"> - <radiogroup id="doNotTrackSelection" orient="vertical" - preference="privacy.donottrackheader.value" - onsynctopreference="return gPrivacyPane.setTrackingPrefs()" - onsyncfrompreference="return gPrivacyPane.getTrackingPrefs()"> - <radio id="dntnotrack" value="1" label="&dntTrackingNotOkay.label2;" - accesskey="&dntTrackingNotOkay.accesskey;" /> - <radio id="dntdotrack" value="0" label="&dntTrackingOkay.label2;" - accesskey="&dntTrackingOkay.accesskey;" /> - <radio id="dntnopref" value="-1" label="&dntTrackingNopref.label2;" - accesskey="&dntTrackingNopref.accesskey;" /> - </radiogroup> + <checkbox id="privacyDoNotTrackCheckbox" + label="&dntTrackingNotOkay.label2;" + accesskey="&dntTrackingNotOkay.accesskey;" + preference="privacy.donottrackheader.enabled"/> + <separator class="thin"/> <label class="text-link" id="doNotTrackInfo" href="https://www.mozilla.org/dnt" value="&doNotTrackInfo.label;"/> diff --git a/application/palemoon/components/preferences/security.xul b/application/palemoon/components/preferences/security.xul index 43352b926..d3d321b16 100644 --- a/application/palemoon/components/preferences/security.xul +++ b/application/palemoon/components/preferences/security.xul @@ -43,8 +43,8 @@ <!-- Security Protocols --> - <preference id="network.stricttransportsecurity.enabled" - name="network.stricttransportsecurity.enabled" + <preference id="network.stricttransportsecurity.preloadlist" + name="network.stricttransportsecurity.preloadlist" type="bool"/> <preference id="security.cert_pinning.enforcement_level" name="security.cert_pinning.enforcement_level" @@ -137,7 +137,7 @@ <checkbox id="enableHSTS" label="&enableHSTS.label;" accesskey="&enableHSTS.accesskey;" - preference="network.stricttransportsecurity.enabled" /> + preference="network.stricttransportsecurity.preloadlist" /> <checkbox id="enableHPKP" label="&enableHPKP.label;" accesskey="&enableHPKP.accesskey;" diff --git a/application/palemoon/components/sessionstore/SessionStore.jsm b/application/palemoon/components/sessionstore/SessionStore.jsm index 4f95f10a7..c5e55321c 100644 --- a/application/palemoon/components/sessionstore/SessionStore.jsm +++ b/application/palemoon/components/sessionstore/SessionStore.jsm @@ -3598,38 +3598,70 @@ var SessionStoreInternal = { var _this = this; function win_(aName) { return _this._getWindowDimension(win, aName); } - // find available space on the screen where this window is being placed + // Find available space on the screen where this window is being placed let screen = gScreenManager.screenForRect(aLeft, aTop, aWidth, aHeight); if (screen && !this._prefBranch.getBoolPref("sessionstore.exactPos")) { let screenLeft = {}, screenTop = {}, screenWidth = {}, screenHeight = {}; screen.GetAvailRectDisplayPix(screenLeft, screenTop, screenWidth, screenHeight); - // constrain the dimensions to the actual space available - if (aWidth > screenWidth.value) { - aWidth = screenWidth.value; + + // Screen X/Y are based on the origin of the screen's desktop-pixel coordinate space + let screenLeftCss = screenLeft.value; + let screenTopCss = screenTop.value; + + // Convert the screen's device pixel dimensions to CSS px dimensions + screen.GetAvailRect(screenLeft, screenTop, screenWidth, screenHeight); + let cssToDevScale = screen.defaultCSSScaleFactor; + let screenRightCss = screenLeftCss + screenWidth.value / cssToDevScale; + let screenBottomCss = screenTopCss + screenHeight.value / cssToDevScale; + + // Pull the window within the screen's bounds. + // First, ensure the left edge is on-screen + if (aLeft < screenLeftCss) { + aLeft = screenLeftCss; } - if (aHeight > screenHeight.value) { - aHeight = screenHeight.value; + // Then check the resulting right edge, and reduce it if necessary. + let right = aLeft + aWidth; + if (right > screenRightCss) { + right = screenRightCss; + // See if we can move the left edge leftwards to maintain width. + if (aLeft > screenLeftCss) { + aLeft = Math.max(right - aWidth, screenLeftCss); + } } - // and then pull the window within the screen's bounds - if (aLeft < screenLeft.value) { - aLeft = screenLeft.value; - } else if (aLeft + aWidth > screenLeft.value + screenWidth.value) { - aLeft = screenLeft.value + screenWidth.value - aWidth; + // Finally, update aWidth to account for the adjusted left and right edges. + aWidth = right - aLeft; + + // Do the same in the vertical dimension. + // First, ensure the top edge is on-screen + if (aTop < screenTopCss) { + aTop = screenTopCss; } - if (aTop < screenTop.value) { - aTop = screenTop.value; - } else if (aTop + aHeight > screenTop.value + screenHeight.value) { - aTop = screenTop.value + screenHeight.value - aHeight; + // Then check the resulting right edge, and reduce it if necessary. + let bottom = aTop + aHeight; + if (bottom > screenBottomCss) { + bottom = screenBottomCss; + // See if we can move the top edge upwards to maintain height. + if (aTop > screenTopCss) { + aTop = Math.max(bottom - aHeight, screenTopCss); + } } + // Finally, update aHeight to account for the adjusted top and bottom edges. + aHeight = bottom - aTop; } - // only modify those aspects which aren't correct yet - if (aWidth && aHeight && (aWidth != win_("width") || aHeight != win_("height"))) { - aWindow.resizeTo(aWidth, aHeight); - } + // Only modify those aspects which aren't correct yet if (!isNaN(aLeft) && !isNaN(aTop) && (aLeft != win_("screenX") || aTop != win_("screenY"))) { aWindow.moveTo(aLeft, aTop); } + if (aWidth && aHeight && (aWidth != win_("width") || aHeight != win_("height"))) { + // Don't resize the window if it's currently maximized and we would + // maximize it again shortly after. + if (aSizeMode != "maximized" || win_("sizemode") != "maximized") { + aWindow.resizeTo(aWidth, aHeight); + } + } + + // Restore window state if (aSizeMode && win_("sizemode") != aSizeMode) { switch (aSizeMode) diff --git a/application/palemoon/components/sessionstore/content/aboutSessionRestore.js b/application/palemoon/components/sessionstore/content/aboutSessionRestore.js index 2459b67f5..2b6f9eaeb 100644 --- a/application/palemoon/components/sessionstore/content/aboutSessionRestore.js +++ b/application/palemoon/components/sessionstore/content/aboutSessionRestore.js @@ -134,6 +134,9 @@ function onListClick(aEvent) { if (aEvent.button == 2) return; + if (!treeView.treeBox) { + return; + } var cell = treeView.treeBox.getCellAt(aEvent.clientX, aEvent.clientY); if (cell.col) { // Restore this specific tab in the same window for middle/double/accel clicking |