From 399efcb8c5c30981c42c89710ad87654efd308ac Mon Sep 17 00:00:00 2001 From: Pale Moon Date: Sun, 26 Jan 2020 12:45:38 +0100 Subject: [PATCH 1/8] [Pale-Moon] Change sessionstore cache behavior to soft refresh It can be assumed that people who launch the browser will do so with network access, restoring tabs to live locations rather than previously-visited static pages. Defaulting this to soft refresh will prevent unnecessarily stale pages from being displayed when restoring tabs, with minimal bandwidth used. Note, this does not affect browser restart sessionstore behavior, which will always re-display previously cached pages "as if nothing happened", which is what we want. --- application/palemoon/app/profile/palemoon.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/palemoon/app/profile/palemoon.js b/application/palemoon/app/profile/palemoon.js index df46ea4b63..48da270712 100644 --- a/application/palemoon/app/profile/palemoon.js +++ b/application/palemoon/app/profile/palemoon.js @@ -863,7 +863,7 @@ pref("browser.sessionstore.restore_pinned_tabs_on_demand", false); // 0 = standard behavior: pull fully from cache // 1 = perform a soft refresh when restoring a tab (check network) // 2 = perform a hard refresh when restoring a tab (bypass cache completely) -pref("browser.sessionstore.cache_behavior", 0); +pref("browser.sessionstore.cache_behavior", 1); // Pale Moon: Allow exact positioning of windows to previous locations, even // if they would be outside of the screen bounds pref("browser.sessionstore.exactPos", false); From 34a4c079371d00c052ae624b93eb8b2ff20acf2b Mon Sep 17 00:00:00 2001 From: Pale Moon Date: Thu, 23 Jan 2020 22:22:48 +0100 Subject: [PATCH 2/8] [Pale-Moon] Issue #1711 - Remove cert9.db and key4.db from profile if they exist. This resolves #1711 --- .../palemoon/components/nsBrowserGlue.js | 36 +++++++++++++++---- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/application/palemoon/components/nsBrowserGlue.js b/application/palemoon/components/nsBrowserGlue.js index 31a8bf40c6..0fa9a9e429 100644 --- a/application/palemoon/components/nsBrowserGlue.js +++ b/application/palemoon/components/nsBrowserGlue.js @@ -1198,7 +1198,7 @@ BrowserGlue.prototype = { }, _migrateUI: function BG__migrateUI() { - const UI_VERSION = 20; + const UI_VERSION = 21; const BROWSER_DOCURL = "chrome://browser/content/browser.xul#"; let currentUIVersion = 0; try { @@ -1397,12 +1397,6 @@ BrowserGlue.prototype = { this._notifyNotificationsUpgrade(); } - if (this._dirty) - this._dataSource.QueryInterface(Ci.nsIRDFRemoteDataSource).Flush(); - - 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" @@ -1438,6 +1432,34 @@ BrowserGlue.prototype = { Services.prefs.clearUserPref("security.cert_pinning.enforcement_level"); } + if (currentUIVersion < 21) { + // Remove key4.db and cert9.db if those files exist + // XXX: Remove this code block once we actually start using them. + let dsCertFile = Cc["@mozilla.org/file/directory_service;1"] + .getService(Ci.nsIProperties) + .get("ProfD", Ci.nsIFile); + dsKeyFile = dsCertFile.clone(); + dsCertFile.append("cert9.db"); + if (dsCertFile.exists()) { + try { + dsCertFile.remove(false); + } catch(e) { } + } + dsKeyFile.append("key4.db"); + if (dsKeyFile.exists()) { + try { + dsKeyFile.remove(false); + } catch(e) { } + } + } + + // Clear out dirty storage + if (this._dirty) + this._dataSource.QueryInterface(Ci.nsIRDFRemoteDataSource).Flush(); + + delete this._rdf; + delete this._dataSource; + // Update the migration version. Services.prefs.setIntPref("browser.migration.version", UI_VERSION); }, From 0dae8965e55d3a2b83cee16249b4281dc14ea0ab Mon Sep 17 00:00:00 2001 From: Pale Moon Date: Sun, 26 Jan 2020 22:29:41 +0100 Subject: [PATCH 3/8] [Pale-Moon] Issue MoonchildProductions/UXP#1360 - Pale Moon front-end changes - Move some options around, group HWA together, and add localization strings for proper display. --- .../palemoon/components/nsBrowserGlue.js | 15 ++++++++++++- .../components/preferences/advanced.js | 15 +++++++++++-- .../components/preferences/advanced.xul | 21 ++++++++++++++----- .../chrome/browser/preferences/advanced.dtd | 7 +++++-- 4 files changed, 48 insertions(+), 10 deletions(-) diff --git a/application/palemoon/components/nsBrowserGlue.js b/application/palemoon/components/nsBrowserGlue.js index 0fa9a9e429..854a067aaf 100644 --- a/application/palemoon/components/nsBrowserGlue.js +++ b/application/palemoon/components/nsBrowserGlue.js @@ -1198,7 +1198,7 @@ BrowserGlue.prototype = { }, _migrateUI: function BG__migrateUI() { - const UI_VERSION = 21; + const UI_VERSION = 22; const BROWSER_DOCURL = "chrome://browser/content/browser.xul#"; let currentUIVersion = 0; try { @@ -1452,6 +1452,19 @@ BrowserGlue.prototype = { } catch(e) { } } } + + if (currentUIVersion < 22) { + if (Services.prefs.prefHasUserValue("layers.acceleration.disabled")) { + let HWADisabled = Service.prefs.getBoolPref("layers.acceleration.disabled"); + Services.prefs.setBoolPref("layers.acceleration.enabled") = !HWADisabled; + Services.prefs.setBoolPref("gfx.direct2d.disabled") = HWADisabled; + } + if (Services.prefs.getBoolPref("layers.acceleration.force-enabled", false)) { + Services.prefs.setBoolPref("layers.acceleration.force", true); + } + Services.prefs.clearUserPref("layers.acceleration.disabled"); + Services.prefs.clearUserPref("layers.acceleration.force-enabled"); + } // Clear out dirty storage if (this._dirty) diff --git a/application/palemoon/components/preferences/advanced.js b/application/palemoon/components/preferences/advanced.js index aab58b3866..ec223f343c 100644 --- a/application/palemoon/components/preferences/advanced.js +++ b/application/palemoon/components/preferences/advanced.js @@ -51,6 +51,8 @@ var gAdvancedPane = { this.updateActualCacheSize(); this.updateActualAppCacheSize(); + this.updateHWADisplay(); + // Notify observers that the UI is now ready Services.obs.notifyObservers(window, "advanced-pane-loaded", null); }, @@ -156,12 +158,21 @@ var gAdvancedPane = { updateHardwareAcceleration: function() { #ifdef XP_WIN - var fromPref = document.getElementById("layers.acceleration.disabled"); + var fromPref = document.getElementById("layers.acceleration.enabled"); var toPref = document.getElementById("gfx.direct2d.disabled"); - toPref.value = fromPref.value; + toPref.value = !fromPref.value; #endif + this.updateHWADisplay(); }, + updateHWADisplay: function() + { +#ifdef XP_LINUX + let HWA = document.getElementById("layers.acceleration.enabled"); + document.getElementById("forceHWAccel").disabled = !HWA.value; +#endif + }, + // DATA CHOICES TAB /** diff --git a/application/palemoon/components/preferences/advanced.xul b/application/palemoon/components/preferences/advanced.xul index e5f3bb160f..24e3df5a09 100644 --- a/application/palemoon/components/preferences/advanced.xul +++ b/application/palemoon/components/preferences/advanced.xul @@ -31,7 +31,7 @@ - #ifdef XP_WIN @@ -152,10 +152,6 @@ label="&useAutoScroll.label;" accesskey="&useAutoScroll.accesskey;" preference="general.autoScroll"/> - + + + + + +#ifdef XP_LINUX + +#endif + + #ifdef HAVE_SHELL_SERVICE diff --git a/application/palemoon/locales/en-US/chrome/browser/preferences/advanced.dtd b/application/palemoon/locales/en-US/chrome/browser/preferences/advanced.dtd index bb8dd12d21..c0a2daa8ec 100644 --- a/application/palemoon/locales/en-US/chrome/browser/preferences/advanced.dtd +++ b/application/palemoon/locales/en-US/chrome/browser/preferences/advanced.dtd @@ -21,10 +21,13 @@ - - + + + + + From 5e0560d8957b67984a05657b981572ea07421e01 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Mon, 27 Jan 2020 04:06:17 -0500 Subject: [PATCH 4/8] [Pale-Moon] Issue MoonchildProductions/UXP#65 - Remove AppConstants Pale Moon.. again. --- .../palemoon/base/content/autocomplete.xml | 32 ++-- .../components/shell/ShellService.jsm | 44 +++-- .../shell/content/setDesktopBackground.js | 169 +++++++++--------- application/palemoon/components/shell/jar.mn | 2 +- .../palemoon/components/shell/moz.build | 2 +- 5 files changed, 128 insertions(+), 121 deletions(-) diff --git a/application/palemoon/base/content/autocomplete.xml b/application/palemoon/base/content/autocomplete.xml index bd0928436f..a9a4d9a831 100644 --- a/application/palemoon/base/content/autocomplete.xml +++ b/application/palemoon/base/content/autocomplete.xml @@ -449,12 +449,14 @@ var cancel = false; - let { AppConstants } = - Components.utils.import("resource://gre/modules/AppConstants.jsm", {}); // Catch any keys that could potentially move the caret. Ctrl can be // used in combination with these keys on Windows and Linux; and Alt // can be used on OS X, so make sure the unused one isn't used. - let metaKey = AppConstants.platform == "macosx" ? aEvent.ctrlKey : aEvent.altKey; +#ifdef XP_MACOSX + let metaKey = aEvent.ctrlKey; +#else + let metaKey = aEvent.altKey; +#endif if (!this.disableKeyNavigation && !metaKey) { switch (aEvent.keyCode) { case KeyEvent.DOM_VK_LEFT: @@ -492,11 +494,11 @@ cancel = this.mController.handleEscape(); break; case KeyEvent.DOM_VK_RETURN: - if (AppConstants.platform == "macosx") { - // Prevent the default action, since it will beep on Mac - if (aEvent.metaKey) - aEvent.preventDefault(); - } +#ifdef XP_MACOSX + // Prevent the default action, since it will beep on Mac + if (aEvent.metaKey) + aEvent.preventDefault(); +#endif this.mEnterEvent = aEvent; if (this.mController.selection) { this._selectionDetails = { @@ -507,15 +509,19 @@ cancel = this.handleEnter(); break; case KeyEvent.DOM_VK_DELETE: - if (AppConstants.platform == "macosx" && !aEvent.shiftKey) { +#ifdef XP_MACOSX + if (!aEvent.shiftKey) { break; } +#endif cancel = this.handleDelete(); break; case KeyEvent.DOM_VK_BACK_SPACE: - if (AppConstants.platform == "macosx" && aEvent.shiftKey) { +#ifdef XP_MACOSX + if (aEvent.shiftKey) { cancel = this.handleDelete(); } +#endif break; case KeyEvent.DOM_VK_DOWN: case KeyEvent.DOM_VK_UP: @@ -523,9 +529,9 @@ this.toggleHistoryPopup(); break; case KeyEvent.DOM_VK_F4: - if (AppConstants.platform != "macosx") { - this.toggleHistoryPopup(); - } +#ifndef XP_MACOSX + this.toggleHistoryPopup(); +#endif break; } diff --git a/application/palemoon/components/shell/ShellService.jsm b/application/palemoon/components/shell/ShellService.jsm index 74632b6926..f453dcbc86 100644 --- a/application/palemoon/components/shell/ShellService.jsm +++ b/application/palemoon/components/shell/ShellService.jsm @@ -8,7 +8,6 @@ this.EXPORTED_SYMBOLS = ["ShellService"]; const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components; -Cu.import("resource://gre/modules/AppConstants.jsm"); Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "WindowsRegistry", @@ -26,20 +25,17 @@ var ShellServiceInternal = { * environments. */ get canSetDesktopBackground() { - if (AppConstants.platform == "win" || - AppConstants.platform == "macosx") { - return true; +#ifdef XP_LINUX + if (this.shellService) { + let linuxShellService = this.shellService + .QueryInterface(Ci.nsIGNOMEShellService); + return linuxShellService.canSetDesktopBackground; } - - if (AppConstants.platform == "linux") { - if (this.shellService) { - let linuxShellService = this.shellService - .QueryInterface(Ci.nsIGNOMEShellService); - return linuxShellService.canSetDesktopBackground; - } - } - +#elif defined(XP_WIN) || defined(XP_MACOSX) + return true; +#else return false; +#endif }, /** @@ -60,18 +56,18 @@ var ShellServiceInternal = { return false; } - if (AppConstants.platform == "win") { - let optOutValue = WindowsRegistry.readRegKey(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER, - "Software\\Mozilla\\PaleMoon", - "DefaultBrowserOptOut"); - WindowsRegistry.removeRegKey(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER, - "Software\\Mozilla\\PaleMoon", - "DefaultBrowserOptOut"); - if (optOutValue == "True") { - Services.prefs.setBoolPref("browser.shell.checkDefaultBrowser", false); - return false; - } +#ifdef XP_WIN + let optOutValue = WindowsRegistry.readRegKey(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER, + "Software\\Mozilla\\PaleMoon", + "DefaultBrowserOptOut"); + WindowsRegistry.removeRegKey(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER, + "Software\\Mozilla\\PaleMoon", + "DefaultBrowserOptOut"); + if (optOutValue == "True") { + Services.prefs.setBoolPref("browser.shell.checkDefaultBrowser", false); + return false; } +#endif return true; }, diff --git a/application/palemoon/components/shell/content/setDesktopBackground.js b/application/palemoon/components/shell/content/setDesktopBackground.js index 53cc70db0d..4c11b9d331 100644 --- a/application/palemoon/components/shell/content/setDesktopBackground.js +++ b/application/palemoon/components/shell/content/setDesktopBackground.js @@ -7,8 +7,13 @@ Components.utils.import("resource://gre/modules/AppConstants.jsm"); var Ci = Components.interfaces; var gSetBackground = { - _position : AppConstants.platform == "macosx" ? "STRETCH" : "", - _backgroundColor : AppConstants.platform != "macosx" ? 0 : undefined, +#ifdef XP_MACOSX + _position : "STRETCH", + _backgroundColor : undefined, +#else + _position : "", + _backgroundColor : 0, +#endif _screenWidth : 0, _screenHeight : 0, _image : null, @@ -25,23 +30,23 @@ var gSetBackground = { this._canvas = document.getElementById("screen"); this._screenWidth = screen.width; this._screenHeight = screen.height; - if (AppConstants.platform == "macosx") { - document.documentElement.getButton("accept").hidden = true; - } +#ifdef XP_MACOSX + document.documentElement.getButton("accept").hidden = true; +#endif if (this._screenWidth / this._screenHeight >= 1.6) document.getElementById("monitor").setAttribute("aspectratio", "16:10"); - if (AppConstants.platform == "win") { - // Hide fill + fit options if < Win7 since they don't work. - var version = Components.classes["@mozilla.org/system-info;1"] - .getService(Ci.nsIPropertyBag2) - .getProperty("version"); - var isWindows7OrHigher = (parseFloat(version) >= 6.1); - if (!isWindows7OrHigher) { - document.getElementById("fillPosition").hidden = true; - document.getElementById("fitPosition").hidden = true; - } +#ifdef XP_WIN + // Hide fill + fit options if < Win7 since they don't work. + var version = Components.classes["@mozilla.org/system-info;1"] + .getService(Ci.nsIPropertyBag2) + .getProperty("version"); + var isWindows7OrHigher = (parseFloat(version) >= 6.1); + if (!isWindows7OrHigher) { + document.getElementById("fillPosition").hidden = true; + document.getElementById("fitPosition").hidden = true; } +#endif // make sure that the correct dimensions will be used setTimeout(function(self) { @@ -60,28 +65,25 @@ var gSetBackground = { var ctx = this._canvas.getContext("2d"); ctx.scale(this._canvas.clientWidth / this._screenWidth, this._canvas.clientHeight / this._screenHeight); - if (AppConstants.platform != "macosx") { - this._initColor(); - } else { - // Make sure to reset the button state in case the user has already - // set an image as their desktop background. - var setDesktopBackground = document.getElementById("setDesktopBackground"); - setDesktopBackground.hidden = false; - var bundle = document.getElementById("backgroundBundle"); - setDesktopBackground.label = bundle.getString("DesktopBackgroundSet"); - setDesktopBackground.disabled = false; +#ifdef XP_MACOSX + // Make sure to reset the button state in case the user has already + // set an image as their desktop background. + var setDesktopBackground = document.getElementById("setDesktopBackground"); + setDesktopBackground.hidden = false; + var bundle = document.getElementById("backgroundBundle"); + setDesktopBackground.label = bundle.getString("DesktopBackgroundSet"); + setDesktopBackground.disabled = false; - document.getElementById("showDesktopPreferences").hidden = true; - } + document.getElementById("showDesktopPreferences").hidden = true; +#else + this._initColor(); +#endif this.updatePosition(); }, setDesktopBackground: function () { - if (AppConstants.platform != "macosx") { - document.persist("menuPosition", "value"); - this._shell.desktopBackgroundColor = this._hexStringToLong(this._backgroundColor); - } else { +#ifdef XP_MACOSX Components.classes["@mozilla.org/observer-service;1"] .getService(Ci.nsIObserverService) .addObserver(this, "shell:desktop-background-changed", false); @@ -90,7 +92,10 @@ var gSetBackground = { var setDesktopBackground = document.getElementById("setDesktopBackground"); setDesktopBackground.disabled = true; setDesktopBackground.label = bundle.getString("DesktopBackgroundDownloading"); - } +#else + document.persist("menuPosition", "value"); + this._shell.desktopBackgroundColor = this._hexStringToLong(this._backgroundColor); +#endif this._shell.setDesktopBackground(this._image, Ci.nsIShellService["BACKGROUND_" + this._position]); }, @@ -100,9 +105,9 @@ var gSetBackground = { var ctx = this._canvas.getContext("2d"); ctx.clearRect(0, 0, this._screenWidth, this._screenHeight); - if (AppConstants.platform != "macosx") { - this._position = document.getElementById("menuPosition").value; - } +#ifndef XP_MACOSX + this._position = document.getElementById("menuPosition").value; +#endif switch (this._position) { case "TILE": @@ -158,57 +163,57 @@ var gSetBackground = { } }; -if (AppConstants.platform != "macosx") { - gSetBackground["_initColor"] = function () - { - var color = this._shell.desktopBackgroundColor; +#ifdef XP_MACOSX +gSetBackground["observe"] = function (aSubject, aTopic, aData) +{ + if (aTopic == "shell:desktop-background-changed") { + document.getElementById("setDesktopBackground").hidden = true; + document.getElementById("showDesktopPreferences").hidden = false; - const rMask = 4294901760; - const gMask = 65280; - const bMask = 255; - var r = (color & rMask) >> 16; - var g = (color & gMask) >> 8; - var b = (color & bMask); - this.updateColor(this._rgbToHex(r, g, b)); + Components.classes["@mozilla.org/observer-service;1"] + .getService(Ci.nsIObserverService) + .removeObserver(this, "shell:desktop-background-changed"); + } +}; - var colorpicker = document.getElementById("desktopColor"); - colorpicker.color = this._backgroundColor; - }; +gSetBackground["showDesktopPrefs"] = function() +{ + this._shell.openApplication(Ci.nsIMacShellService.APPLICATION_DESKTOP); +}; +#else +gSetBackground["_initColor"] = function () +{ + var color = this._shell.desktopBackgroundColor; - gSetBackground["updateColor"] = function (aColor) - { - this._backgroundColor = aColor; - this._canvas.style.backgroundColor = aColor; - }; + const rMask = 4294901760; + const gMask = 65280; + const bMask = 255; + var r = (color & rMask) >> 16; + var g = (color & gMask) >> 8; + var b = (color & bMask); + this.updateColor(this._rgbToHex(r, g, b)); - // Converts a color string in the format "#RRGGBB" to an integer. - gSetBackground["_hexStringToLong"] = function (aString) - { - return parseInt(aString.substring(1, 3), 16) << 16 | - parseInt(aString.substring(3, 5), 16) << 8 | - parseInt(aString.substring(5, 7), 16); - }; + var colorpicker = document.getElementById("desktopColor"); + colorpicker.color = this._backgroundColor; +}; - gSetBackground["_rgbToHex"] = function (aR, aG, aB) - { - return "#" + [aR, aG, aB].map(aInt => aInt.toString(16).replace(/^(.)$/, "0$1")) - .join("").toUpperCase(); - }; -} else { - gSetBackground["observe"] = function (aSubject, aTopic, aData) - { - if (aTopic == "shell:desktop-background-changed") { - document.getElementById("setDesktopBackground").hidden = true; - document.getElementById("showDesktopPreferences").hidden = false; +gSetBackground["updateColor"] = function (aColor) +{ + this._backgroundColor = aColor; + this._canvas.style.backgroundColor = aColor; +}; - Components.classes["@mozilla.org/observer-service;1"] - .getService(Ci.nsIObserverService) - .removeObserver(this, "shell:desktop-background-changed"); - } - }; +// Converts a color string in the format "#RRGGBB" to an integer. +gSetBackground["_hexStringToLong"] = function (aString) +{ + return parseInt(aString.substring(1, 3), 16) << 16 | + parseInt(aString.substring(3, 5), 16) << 8 | + parseInt(aString.substring(5, 7), 16); +}; - gSetBackground["showDesktopPrefs"] = function() - { - this._shell.openApplication(Ci.nsIMacShellService.APPLICATION_DESKTOP); - }; -} +gSetBackground["_rgbToHex"] = function (aR, aG, aB) +{ + return "#" + [aR, aG, aB].map(aInt => aInt.toString(16).replace(/^(.)$/, "0$1")) + .join("").toUpperCase(); +}; +#endif diff --git a/application/palemoon/components/shell/jar.mn b/application/palemoon/components/shell/jar.mn index 0864e1b306..39303f275b 100644 --- a/application/palemoon/components/shell/jar.mn +++ b/application/palemoon/components/shell/jar.mn @@ -4,4 +4,4 @@ browser.jar: * content/browser/setDesktopBackground.xul (content/setDesktopBackground.xul) - content/browser/setDesktopBackground.js (content/setDesktopBackground.js) +* content/browser/setDesktopBackground.js (content/setDesktopBackground.js) diff --git a/application/palemoon/components/shell/moz.build b/application/palemoon/components/shell/moz.build index 16bffd7d9d..b11d9747c8 100644 --- a/application/palemoon/components/shell/moz.build +++ b/application/palemoon/components/shell/moz.build @@ -32,7 +32,7 @@ EXTRA_COMPONENTS += [ 'nsSetDefaultBrowser.manifest', ] -EXTRA_JS_MODULES += ['ShellService.jsm'] +EXTRA_PP_JS_MODULES += ['ShellService.jsm'] for var in ('MOZ_APP_NAME', 'MOZ_APP_VERSION'): DEFINES[var] = '"%s"' % CONFIG[var] From 2814613a7634fd2a7fde811c6070e76531f1d4d4 Mon Sep 17 00:00:00 2001 From: Pale Moon Date: Mon, 27 Jan 2020 13:37:57 +0100 Subject: [PATCH 5/8] [Pale-Moon] Issue MoonchildProductions/UXP#1360 - Fix a dumb mistake. --- application/palemoon/components/nsBrowserGlue.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/palemoon/components/nsBrowserGlue.js b/application/palemoon/components/nsBrowserGlue.js index 854a067aaf..d8bc5be7e7 100644 --- a/application/palemoon/components/nsBrowserGlue.js +++ b/application/palemoon/components/nsBrowserGlue.js @@ -1456,8 +1456,8 @@ BrowserGlue.prototype = { if (currentUIVersion < 22) { if (Services.prefs.prefHasUserValue("layers.acceleration.disabled")) { let HWADisabled = Service.prefs.getBoolPref("layers.acceleration.disabled"); - Services.prefs.setBoolPref("layers.acceleration.enabled") = !HWADisabled; - Services.prefs.setBoolPref("gfx.direct2d.disabled") = HWADisabled; + Services.prefs.setBoolPref("layers.acceleration.enabled", !HWADisabled); + Services.prefs.setBoolPref("gfx.direct2d.disabled", HWADisabled); } if (Services.prefs.getBoolPref("layers.acceleration.force-enabled", false)) { Services.prefs.setBoolPref("layers.acceleration.force", true); From 3ba984e8ac636f201fca0f7a00b371b94aee8d7c Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Sat, 25 Jan 2020 12:03:03 -0500 Subject: [PATCH 6/8] [Basilisk] Issue #4 - Update appstrings.properties changing hardcoded Firefox to Basilisk We really need a better solution for this not only here but also for Pale Moon --- .../chrome/overrides/appstrings.properties | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/application/basilisk/locales/en-US/chrome/overrides/appstrings.properties b/application/basilisk/locales/en-US/chrome/overrides/appstrings.properties index 02682c89c5..fac57471a0 100644 --- a/application/basilisk/locales/en-US/chrome/overrides/appstrings.properties +++ b/application/basilisk/locales/en-US/chrome/overrides/appstrings.properties @@ -3,25 +3,25 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. malformedURI=The URL is not valid and cannot be loaded. -fileNotFound=Firefox can’t find the file at %S. +fileNotFound=Basilisk can’t find the file at %S. fileAccessDenied=The file at %S is not readable. -dnsNotFound=Firefox can’t find the server at %S. -unknownProtocolFound=Firefox doesn’t know how to open this address, because one of the following protocols (%S) isn’t associated with any program or is not allowed in this context. +dnsNotFound=Basilisk can’t find the server at %S. +unknownProtocolFound=Basilisk doesn’t know how to open this address, because one of the following protocols (%S) isn’t associated with any program or is not allowed in this context. connectionFailure=Firefox can’t establish a connection to the server at %S. netInterrupt=The connection to %S was interrupted while the page was loading. netTimeout=The server at %S is taking too long to respond. -redirectLoop=Firefox has detected that the server is redirecting the request for this address in a way that will never complete. +redirectLoop=Basilisk has detected that the server is redirecting the request for this address in a way that will never complete. ## LOCALIZATION NOTE (confirmRepostPrompt): In this item, don’t translate "%S" confirmRepostPrompt=To display this page, %S must send information that will repeat any action (such as a search or order confirmation) that was performed earlier. resendButton.label=Resend -unknownSocketType=Firefox doesn’t know how to communicate with the server. +unknownSocketType=Basilisk doesn’t know how to communicate with the server. netReset=The connection to the server was reset while the page was loading. notCached=This document is no longer available. -netOffline=Firefox is currently in offline mode and can’t browse the Web. +netOffline=Basilisk is currently in offline mode and can’t browse the Web. isprinting=The document cannot change while Printing or in Print Preview. -deniedPortAccess=This address uses a network port which is normally used for purposes other than Web browsing. Firefox has canceled the request for your protection. -proxyResolveFailure=Firefox is configured to use a proxy server that can’t be found. -proxyConnectFailure=Firefox is configured to use a proxy server that is refusing connections. +deniedPortAccess=This address uses a network port which is normally used for purposes other than Web browsing. Basilisk has canceled the request for your protection. +proxyResolveFailure=Basilisk is configured to use a proxy server that can’t be found. +proxyConnectFailure=Basilisk is configured to use a proxy server that is refusing connections. contentEncodingError=The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression. unsafeContentType=The page you are trying to view cannot be shown because it is contained in a file type that may not be safe to open. Please contact the website owners to inform them of this problem. externalProtocolTitle=External Protocol Request @@ -35,9 +35,9 @@ unwantedBlocked=The site at %S has been reported as serving unwanted software an deceptiveBlocked=This web page at %S has been reported as a deceptive site and has been blocked based on your security preferences. cspBlocked=This page has a content security policy that prevents it from being loaded in this way. corruptedContentErrorv2=The site at %S has experienced a network protocol violation that cannot be repaired. -remoteXUL=This page uses an unsupported technology that is no longer available by default in Firefox. +remoteXUL=This page uses an unsupported technology that is no longer available by default in Basilisk. ## LOCALIZATION NOTE (sslv3Used) - Do not translate "%S". -sslv3Used=Firefox cannot guarantee the safety of your data on %S because it uses SSLv3, a broken security protocol. +sslv3Used=Basilisk cannot guarantee the safety of your data on %S because it uses SSLv3, a broken security protocol. ## LOCALIZATION NOTE (weakCryptoUsed) - Do not translate "%S". -weakCryptoUsed=The owner of %S has configured their website improperly. To protect your information from being stolen, Firefox has not connected to this website. +weakCryptoUsed=The owner of %S has configured their website improperly. To protect your information from being stolen, Basilisk has not connected to this website. inadequateSecurityError=The website tried to negotiate an inadequate level of security. From cea29e039aee4fff142c3a7c4fd5dbe1b7e7d6ce Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Sat, 25 Jan 2020 12:41:43 -0500 Subject: [PATCH 7/8] [Basilisk] Issue #3 - Update NSIS Publisher string --- application/basilisk/installer/windows/nsis/shared.nsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/basilisk/installer/windows/nsis/shared.nsh b/application/basilisk/installer/windows/nsis/shared.nsh index f5bbef389c..fbcac7444e 100644 --- a/application/basilisk/installer/windows/nsis/shared.nsh +++ b/application/basilisk/installer/windows/nsis/shared.nsh @@ -533,7 +533,7 @@ ${WriteRegStr2} $1 "$0" "DisplayVersion" "${AppVersion}" 0 ${WriteRegStr2} $1 "$0" "HelpLink" "${HelpLink}" 0 ${WriteRegStr2} $1 "$0" "InstallLocation" "$8" 0 - ${WriteRegStr2} $1 "$0" "Publisher" "Mozilla" 0 + ${WriteRegStr2} $1 "$0" "Publisher" "Moonchild Productions" 0 ${WriteRegStr2} $1 "$0" "UninstallString" "$\"$8\uninstall\helper.exe$\"" 0 DeleteRegValue SHCTX "$0" "URLInfoAbout" ; Don't add URLUpdateInfo which is the release notes url except for the release From 1fcfbaa4b285361810c7d0fc6618aeb941fe96ed Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Sat, 25 Jan 2020 12:49:36 -0500 Subject: [PATCH 8/8] [Basilisk] Issue #2 - Enable WASM and its Baseline JIT in application preferences --- application/basilisk/app/profile/basilisk.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/application/basilisk/app/profile/basilisk.js b/application/basilisk/app/profile/basilisk.js index a773bc60ef..b721370a11 100644 --- a/application/basilisk/app/profile/basilisk.js +++ b/application/basilisk/app/profile/basilisk.js @@ -1364,3 +1364,7 @@ pref("services.sync.validation.enabled", true); // The counter resets when the page is reloaded from the UI // (content-reloads do NOT clear this to mitigate reloading tricks). pref("prompts.authentication_dialog_abuse_limit", 3); + +// Enable WASM and its baseline jit (platform default is false) +pref("javascript.options.wasm", true); +pref("javascript.options.wasm_baselinejit", true); \ No newline at end of file