diff --git a/application/basilisk/app/profile/basilisk.js b/application/basilisk/app/profile/basilisk.js
index 1a4c2a63a6..0bcacef786 100644
--- a/application/basilisk/app/profile/basilisk.js
+++ b/application/basilisk/app/profile/basilisk.js
@@ -457,6 +457,16 @@ pref("dom.disable_window_move_resize", false);
// prevent JS from monkeying with window focus, etc
pref("dom.disable_window_flip", true);
+// Whether performance.GetEntries* will contain an entry for the active document
+// Disabled by default in Basilisk (unlike in UXP) since it can be used for
+// tracking/profiling.
+pref("dom.enable_performance_navigation_timing", false);
+
+// This pref controls whether PerformanceObserver is enabled or not.
+// We enable it by default, unlike UXP and Pale Moon because several sites are
+// beginning to expect this to be present.
+pref("dom.enable_performance_observer", true);
+
// popups.policy 1=allow,2=reject
pref("privacy.popups.policy", 1);
pref("privacy.popups.usecustom", true);
diff --git a/application/basilisk/branding/shared/uaoverrides.inc b/application/basilisk/branding/shared/uaoverrides.inc
index cffa9d1318..3d51febca9 100644
--- a/application/basilisk/branding/shared/uaoverrides.inc
+++ b/application/basilisk/branding/shared/uaoverrides.inc
@@ -9,7 +9,7 @@
#define GK_SLICE Gecko/20100101
#define FX_SLICE Firefox/@GK_VERSION@
-#define PALE_MOON_VERSION 32.0.1
+#define PALE_MOON_VERSION 32.4.1
#define PALE_MOON_SLICE PaleMoon/@PALE_MOON_VERSION@
// %OS_SLICE% macro is resolved at runtime, see MoonchildProductions/UXP/issues/1473
@@ -56,7 +56,6 @@ pref("@GUAO_PREF@.firefox.com","Mozilla/5.0 (%OS_SLICE% rv:@UXP_VERSION@) @UXP_D
pref("@GUAO_PREF@.mozilla.org","Mozilla/5.0 (%OS_SLICE% rv:@UXP_VERSION@) @UXP_DATE_SLICE@ @APP_SLICE@");
pref("@GUAO_PREF@.mozilla.com","Mozilla/5.0 (%OS_SLICE% rv:@UXP_VERSION@) @UXP_DATE_SLICE@ @APP_SLICE@");
pref("@GUAO_PREF@.github.com","Mozilla/5.0 (%OS_SLICE% rv:@UXP_VERSION@) @UXP_DATE_SLICE@ @APP_SLICE@");
-pref("@GUAO_PREF@.spotify.com","Mozilla/5.0 (%OS_SLICE% rv:@UXP_VERSION@) @UXP_DATE_SLICE@ @APP_SLICE@");
pref("@GUAO_PREF@.twitter.com","Mozilla/5.0 (%OS_SLICE% rv:@UXP_VERSION@) @UXP_DATE_SLICE@ @APP_SLICE@");
pref("@GUAO_PREF@.zoho.com","Mozilla/5.0 (%OS_SLICE% rv:@UXP_VERSION@) @UXP_DATE_SLICE@ @APP_SLICE@");
@@ -65,9 +64,8 @@ pref("@GUAO_PREF@.humblebundle.com","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @G
pref("@GUAO_PREF@.privat24.ua","Mozilla/5.0 (%OS_SLICE% rv:38.0) @GK_SLICE@ Firefox/38.0");
pref("@GUAO_PREF@.citi.com","Mozilla/5.0 (%OS_SLICE% rv:68.0) @GK_SLICE@ Firefox/68.0 SeaMonkey/2.53.12");
pref("@GUAO_PREF@.facebook.com","Mozilla/5.0 (%OS_SLICE% rv:68.0) @GK_SLICE@ Firefox/68.0 @APP_SLICE@");
-pref("@GUAO_PREF@.netflix.com","Mozilla/5.0 (Windows NT 6.1; rv:45.9) @GK_SLICE@ Firefox/45.9");
-pref("@GUAO_PREF@.netflximg.net","Mozilla/5.0 (Windows NT 6.1; rv:45.9) @GK_SLICE@ Firefox/45.9");
pref("@GUAO_PREF@.mewe.com", "Mozilla/5.0 (%OS_SLICE% rv:102.0) Gecko/20100101 Firefox/102.0");
+pref("@GUAO_PREF@.spotify.com","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@");
// UA-sniffing domains that are "app/vendor-specific" and do not like Basilisk
pref("@GUAO_PREF@.web.whatsapp.com","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36");
@@ -85,7 +83,7 @@ pref("@GUAO_PREF@.ldoceonline.com","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK
pref("@GUAO_PREF@.yuku.com","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@ @APP_SLICE@");
// Domains Basilisk overrides that are not in the Pale Moon overrides
-pref("@GUAO_PREF@.slack.com","Mozilla/5.0 (%OS_SLICE% rv:100.0) @GK_SLICE@ Firefox/100.0 @APP_SLICE@");
+pref("@GUAO_PREF@.slack.com","Mozilla/5.0 (%OS_SLICE% rv:120.0) @GK_SLICE@ Firefox/120.0 @APP_SLICE@");
// There are multiple addons on the Pale Moon addons site that work with Basilisk that are not listed on the Basilisk addons site.
pref("@GUAO_PREF@.addons.palemoon.org","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @UXP_VERSION_SLICE@ @FX_SLICE@ @PALE_MOON_SLICE@");
diff --git a/application/basilisk/components/preferences/in-content/content.xul b/application/basilisk/components/preferences/in-content/content.xul
index fac864411d..b2e18d79d2 100644
--- a/application/basilisk/components/preferences/in-content/content.xul
+++ b/application/basilisk/components/preferences/in-content/content.xul
@@ -22,6 +22,16 @@
+
+
+
+#ifdef MOZ_WEBRTC
+
+#endif
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/application/basilisk/locales/en-US/chrome/browser/preferences/content.dtd b/application/basilisk/locales/en-US/chrome/browser/preferences/content.dtd
index d1d83b3bc4..bca4824f5a 100644
--- a/application/basilisk/locales/en-US/chrome/browser/preferences/content.dtd
+++ b/application/basilisk/locales/en-US/chrome/browser/preferences/content.dtd
@@ -43,3 +43,12 @@
+
+
+
+
+
+#ifdef MOZ_WEBRTC
+
+
+#endif
diff --git a/application/basilisk/locales/jar.mn b/application/basilisk/locales/jar.mn
index 80c956c1d0..5452ce2f54 100644
--- a/application/basilisk/locales/jar.mn
+++ b/application/basilisk/locales/jar.mn
@@ -57,7 +57,7 @@
locale/browser/preferences/applicationManager.properties (%chrome/browser/preferences/applicationManager.properties)
locale/browser/preferences/colors.dtd (%chrome/browser/preferences/colors.dtd)
locale/browser/preferences/cookies.dtd (%chrome/browser/preferences/cookies.dtd)
- locale/browser/preferences/content.dtd (%chrome/browser/preferences/content.dtd)
+* locale/browser/preferences/content.dtd (%chrome/browser/preferences/content.dtd)
locale/browser/preferences/connection.dtd (%chrome/browser/preferences/connection.dtd)
locale/browser/preferences/applications.dtd (%chrome/browser/preferences/applications.dtd)
locale/browser/preferences/fonts.dtd (%chrome/browser/preferences/fonts.dtd)
diff --git a/application/basilisk/moz.build b/application/basilisk/moz.build
index 7166b81f48..2270476f9d 100644
--- a/application/basilisk/moz.build
+++ b/application/basilisk/moz.build
@@ -23,10 +23,6 @@ DIRS += [
if CONFIG['MAKENSISU']:
DIRS += ['installer/windows']
-TEST_DIRS += [
- 'tools/mozscreenshots',
-]
-
DIST_SUBDIR = 'browser'
export('DIST_SUBDIR')
diff --git a/application/basilisk/tools/mozscreenshots/.eslintrc.js b/application/basilisk/tools/mozscreenshots/.eslintrc.js
deleted file mode 100644
index 55b05398ea..0000000000
--- a/application/basilisk/tools/mozscreenshots/.eslintrc.js
+++ /dev/null
@@ -1,15 +0,0 @@
-"use strict";
-
-module.exports = { // eslint-disable-line no-undef
- "extends": [
- "../../../testing/mochitest/browser.eslintrc.js"
- ],
-
- "rules": {
- "no-unused-vars": ["error", {
- "vars": "all",
- "varsIgnorePattern": "^(Cc|Ci|Cr|Cu|EXPORTED_SYMBOLS)$",
- "args": "none"
- }]
- }
-};
diff --git a/application/basilisk/tools/mozscreenshots/browser.ini b/application/basilisk/tools/mozscreenshots/browser.ini
deleted file mode 100644
index e72a3acb45..0000000000
--- a/application/basilisk/tools/mozscreenshots/browser.ini
+++ /dev/null
@@ -1,12 +0,0 @@
-[DEFAULT]
-subsuite = screenshots
-support-files =
- head.js
- mozscreenshots/extension/lib/permissionPrompts.html
- mozscreenshots/extension/lib/controlCenter/password.html
- mozscreenshots/extension/lib/controlCenter/mixed.html
- mozscreenshots/extension/lib/controlCenter/mixed_active.html
- mozscreenshots/extension/lib/controlCenter/mixed_passive.html
- mozscreenshots/extension/lib/borderify.xpi
-
-[browser_screenshots.js]
diff --git a/application/basilisk/tools/mozscreenshots/browser_screenshots.js b/application/basilisk/tools/mozscreenshots/browser_screenshots.js
deleted file mode 100644
index 502f90fec2..0000000000
--- a/application/basilisk/tools/mozscreenshots/browser_screenshots.js
+++ /dev/null
@@ -1,16 +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/. */
-
-"use strict";
-
-add_task(function* capture() {
- let setsEnv = env.get("MOZSCREENSHOTS_SETS");
- if (!setsEnv) {
- ok(true, "MOZSCREENSHOTS_SETS wasn't specified so there's nothing to capture");
- return;
- }
-
- let sets = setsEnv.trim().split(",");
- yield TestRunner.start(sets);
-});
diff --git a/application/basilisk/tools/mozscreenshots/controlCenter/browser.ini b/application/basilisk/tools/mozscreenshots/controlCenter/browser.ini
deleted file mode 100644
index f5b084edc3..0000000000
--- a/application/basilisk/tools/mozscreenshots/controlCenter/browser.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[DEFAULT]
-subsuite = screenshots
-support-files =
- ../head.js
-
-[browser_controlCenter.js]
diff --git a/application/basilisk/tools/mozscreenshots/controlCenter/browser_controlCenter.js b/application/basilisk/tools/mozscreenshots/controlCenter/browser_controlCenter.js
deleted file mode 100644
index 7e1ffb1255..0000000000
--- a/application/basilisk/tools/mozscreenshots/controlCenter/browser_controlCenter.js
+++ /dev/null
@@ -1,16 +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/. */
-
-/* import-globals-from ../head.js */
-
-"use strict";
-
-add_task(function* capture() {
- if (!shouldCapture()) {
- return;
- }
- let sets = ["LightweightThemes", "ControlCenter"];
-
- yield TestRunner.start(sets, "controlCenter");
-});
diff --git a/application/basilisk/tools/mozscreenshots/devtools/browser.ini b/application/basilisk/tools/mozscreenshots/devtools/browser.ini
deleted file mode 100644
index e4fa0a988a..0000000000
--- a/application/basilisk/tools/mozscreenshots/devtools/browser.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[DEFAULT]
-subsuite = screenshots
-support-files =
- ../head.js
-
-[browser_devtools.js]
diff --git a/application/basilisk/tools/mozscreenshots/devtools/browser_devtools.js b/application/basilisk/tools/mozscreenshots/devtools/browser_devtools.js
deleted file mode 100644
index a47548958d..0000000000
--- a/application/basilisk/tools/mozscreenshots/devtools/browser_devtools.js
+++ /dev/null
@@ -1,16 +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/. */
-
-/* import-globals-from ../head.js */
-
-"use strict";
-
-add_task(function* capture() {
- if (!shouldCapture()) {
- return;
- }
- let sets = ["DevTools"];
-
- yield TestRunner.start(sets, "devtools");
-});
diff --git a/application/basilisk/tools/mozscreenshots/head.js b/application/basilisk/tools/mozscreenshots/head.js
deleted file mode 100644
index c1702ab089..0000000000
--- a/application/basilisk/tools/mozscreenshots/head.js
+++ /dev/null
@@ -1,53 +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/. */
-
-/* exported TestRunner, shouldCapture */
-
-"use strict";
-
-const {AddonWatcher} = Cu.import("resource://gre/modules/AddonWatcher.jsm", {});
-const chromeRegistry = Cc["@mozilla.org/chrome/chrome-registry;1"].getService(Ci.nsIChromeRegistry);
-const env = Cc["@mozilla.org/process/environment;1"].getService(Ci.nsIEnvironment);
-const EXTENSION_DIR = "chrome://mochitests/content/extensions/mozscreenshots/browser/";
-
-let TestRunner;
-
-function* setup() {
- requestLongerTimeout(10);
-
- info("installing extension temporarily");
- let chromeURL = Services.io.newURI(EXTENSION_DIR, null, null);
- let dir = chromeRegistry.convertChromeURL(chromeURL).QueryInterface(Ci.nsIFileURL).file;
- yield AddonManager.installTemporaryAddon(dir);
-
- info("Checking for mozscreenshots extension");
- return new Promise((resolve) => {
- AddonManager.getAddonByID("mozscreenshots@mozilla.org", function(aAddon) {
- isnot(aAddon, null, "The mozscreenshots extension should be installed");
- AddonWatcher.ignoreAddonPermanently(aAddon.id);
- TestRunner = Cu.import("chrome://mozscreenshots/content/TestRunner.jsm", {}).TestRunner;
- resolve();
- });
- });
-}
-
-function shouldCapture() {
- // Try pushes only capture in browser_screenshots.js with MOZSCREENSHOTS_SETS.
- if (env.get("MOZSCREENSHOTS_SETS")) {
- ok(true, "MOZSCREENSHOTS_SETS was specified so only capture what was " +
- "requested (in browser_screenshots.js)");
- return false;
- }
-
- // Automation isn't able to schedule test jobs to only run on nightlies so we handle it here
- // (see also: bug 1116275).
- let capture = AppConstants.MOZ_UPDATE_CHANNEL == "nightly" ||
- AppConstants.SOURCE_REVISION_URL == "";
- if (!capture) {
- ok(true, "Capturing is disabled for this MOZ_UPDATE_CHANNEL or REPO");
- }
- return capture;
-}
-
-add_task(setup);
diff --git a/application/basilisk/tools/mozscreenshots/moz.build b/application/basilisk/tools/mozscreenshots/moz.build
deleted file mode 100644
index f5f5c06842..0000000000
--- a/application/basilisk/tools/mozscreenshots/moz.build
+++ /dev/null
@@ -1,19 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# 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_CHROME_MANIFESTS += [
- # Each test is in it's own directory so it gets run in a clean profile with
- # run-by-dir.
- 'browser.ini',
- 'controlCenter/browser.ini',
- 'devtools/browser.ini',
- 'permissionPrompts/browser.ini',
- 'preferences/browser.ini',
- 'primaryUI/browser.ini',
-]
-
-TEST_DIRS += [
- 'mozscreenshots/extension',
-]
diff --git a/application/basilisk/tools/mozscreenshots/mozscreenshots/extension/Makefile.in b/application/basilisk/tools/mozscreenshots/mozscreenshots/extension/Makefile.in
deleted file mode 100644
index b0004aaa7b..0000000000
--- a/application/basilisk/tools/mozscreenshots/mozscreenshots/extension/Makefile.in
+++ /dev/null
@@ -1,12 +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/.
-
-TEST_EXTENSIONS_DIR = $(DEPTH)/_tests/testing/mochitest/extensions
-GENERATED_DIRS = $(TEST_EXTENSIONS_DIR)
-XPI_PKGNAME = mozscreenshots@mozilla.org
-
-include $(topsrcdir)/config/rules.mk
-
-libs::
- (cd $(DIST)/xpi-stage && tar $(TAR_CREATE_FLAGS) - $(XPI_NAME)) | (cd $(TEST_EXTENSIONS_DIR) && tar -xf -)
diff --git a/application/basilisk/tools/mozscreenshots/mozscreenshots/extension/Screenshot.jsm b/application/basilisk/tools/mozscreenshots/mozscreenshots/extension/Screenshot.jsm
deleted file mode 100644
index c43514e941..0000000000
--- a/application/basilisk/tools/mozscreenshots/mozscreenshots/extension/Screenshot.jsm
+++ /dev/null
@@ -1,179 +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/. */
-
-"use strict";
-
-this.EXPORTED_SYMBOLS = ["Screenshot"];
-
-const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/Timer.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/osfile.jsm");
-
-// Create a new instance of the ConsoleAPI so we can control the maxLogLevel with a pref.
-// See LOG_LEVELS in Console.jsm. Common examples: "All", "Info", "Warn", & "Error".
-const PREF_LOG_LEVEL = "extensions.mozscreenshots@mozilla.org.loglevel";
-XPCOMUtils.defineLazyGetter(this, "log", () => {
- let ConsoleAPI = Cu.import("resource://gre/modules/Console.jsm", {}).ConsoleAPI;
- let consoleOptions = {
- maxLogLevel: "info",
- maxLogLevelPref: PREF_LOG_LEVEL,
- prefix: "mozscreenshots",
- };
- return new ConsoleAPI(consoleOptions);
-});
-
-this.Screenshot = {
- _extensionPath: null,
- _path: null,
- _imagePrefix: "",
- _imageExtension: ".png",
- _screenshotFunction: null,
-
- init(path, extensionPath, imagePrefix = "") {
- this._path = path;
-
- let dir = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
- dir.initWithPath(this._path);
- if (!dir.exists()) {
- dir.create(Ci.nsIFile.DIRECTORY_TYPE, 0o755);
- }
-
- this._extensionPath = extensionPath;
- this._imagePrefix = imagePrefix;
- switch (Services.appinfo.OS) {
- case "WINNT":
- this._screenshotFunction = this._screenshotWindows;
- break;
- case "Darwin":
- this._screenshotFunction = this._screenshotOSX;
- break;
- case "Linux":
- this._screenshotFunction = this._screenshotLinux;
- break;
- default:
- throw new Error("Unsupported operating system");
- }
- },
-
- _buildImagePath(baseName) {
- return OS.Path.join(this._path, this._imagePrefix + baseName + this._imageExtension);
- },
-
- // Capture the whole screen using an external application.
- captureExternal(filename) {
- let imagePath = this._buildImagePath(filename);
- return this._screenshotFunction(imagePath).then(() => {
- log.debug("saved screenshot: " + filename);
- });
- },
-
- // helpers
-
- _screenshotWindows(filename) {
- return new Promise((resolve, reject) => {
- let exe = Services.dirsvc.get("GreBinD", Ci.nsIFile);
- exe.append("screenshot.exe");
- if (!exe.exists()) {
- exe = Services.dirsvc.get("CurWorkD", Ci.nsIFile).parent;
- exe.append("bin");
- exe.append("screenshot.exe");
- }
- let process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);
- process.init(exe);
-
- let args = [filename];
- process.runAsync(args, args.length, this._processObserver(resolve, reject));
- });
- },
-
- _screenshotOSX: Task.async(function*(filename) {
- let screencapture = (windowID = null) => {
- return new Promise((resolve, reject) => {
- // Get the screencapture executable
- let file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
- file.initWithPath("/usr/sbin/screencapture");
-
- let process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);
- process.init(file);
-
- // Run the process.
- let args = ["-x", "-t", "png"];
- // Darwin version number for OS X 10.6 is 10.x
- if (windowID && Services.sysinfo.getProperty("version").indexOf("10.") !== 0) {
- // Capture only that window on 10.7+
- args.push("-l");
- args.push(windowID);
- }
- args.push(filename);
- process.runAsync(args, args.length, this._processObserver(resolve, reject));
- });
- };
-
- function readWindowID() {
- let decoder = new TextDecoder();
- let promise = OS.File.read("/tmp/mozscreenshots-windowid");
- return promise.then(function onSuccess(array) {
- return decoder.decode(array);
- });
- }
-
- let promiseWindowID = () => {
- return new Promise((resolve, reject) => {
- // Get the window ID of the application (assuming its front-most)
- let osascript = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
- osascript.initWithPath("/bin/bash");
-
- let osascriptP = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);
- osascriptP.init(osascript);
- let osaArgs = ["-c", "/usr/bin/osascript -e 'tell application (path to frontmost application as text) to set winID to id of window 1' > /tmp/mozscreenshots-windowid"];
- osascriptP.runAsync(osaArgs, osaArgs.length, this._processObserver(resolve, reject));
- });
- };
-
- yield promiseWindowID();
- let windowID = yield readWindowID();
- yield screencapture(windowID);
- }),
-
- _screenshotLinux(filename) {
- return new Promise((resolve, reject) => {
- let exe = Services.dirsvc.get("GreBinD", Ci.nsIFile);
- exe.append("screentopng");
- if (!exe.exists()) {
- exe = Services.dirsvc.get("CurWorkD", Ci.nsIFile).parent;
- exe.append("bin");
- exe.append("screentopng");
- }
- let process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);
- process.init(exe);
-
- let args = [filename];
- process.runAsync(args, args.length, this._processObserver(resolve, reject));
- });
- },
-
- _processObserver(resolve, reject) {
- return {
- observe(subject, topic, data) {
- switch (topic) {
- case "process-finished":
- try {
- // Wait 1s after process to resolve
- setTimeout(resolve, 1000);
- } catch (ex) {
- reject(ex);
- }
- break;
- default:
- reject(topic);
- break;
- }
- },
- };
- },
-};
diff --git a/application/basilisk/tools/mozscreenshots/mozscreenshots/extension/TestRunner.jsm b/application/basilisk/tools/mozscreenshots/mozscreenshots/extension/TestRunner.jsm
deleted file mode 100644
index 557b867b9b..0000000000
--- a/application/basilisk/tools/mozscreenshots/mozscreenshots/extension/TestRunner.jsm
+++ /dev/null
@@ -1,279 +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/. */
-
-"use strict";
-
-this.EXPORTED_SYMBOLS = ["TestRunner"];
-
-const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-const env = Cc["@mozilla.org/process/environment;1"].getService(Ci.nsIEnvironment);
-const APPLY_CONFIG_TIMEOUT_MS = 60 * 1000;
-const HOME_PAGE = "chrome://mozscreenshots/content/lib/mozscreenshots.html";
-
-Cu.import("resource://gre/modules/FileUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/Timer.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/osfile.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "BrowserTestUtils",
- "resource://testing-common/BrowserTestUtils.jsm");
-
-Cu.import("chrome://mozscreenshots/content/Screenshot.jsm");
-
-// Create a new instance of the ConsoleAPI so we can control the maxLogLevel with a pref.
-// See LOG_LEVELS in Console.jsm. Common examples: "All", "Info", "Warn", & "Error".
-const PREF_LOG_LEVEL = "extensions.mozscreenshots@mozilla.org.loglevel";
-XPCOMUtils.defineLazyGetter(this, "log", () => {
- let ConsoleAPI = Cu.import("resource://gre/modules/Console.jsm", {}).ConsoleAPI;
- let consoleOptions = {
- maxLogLevel: "info",
- maxLogLevelPref: PREF_LOG_LEVEL,
- prefix: "mozscreenshots",
- };
- return new ConsoleAPI(consoleOptions);
-});
-
-this.TestRunner = {
- combos: null,
- completedCombos: 0,
- currentComboIndex: 0,
- _lastCombo: null,
- _libDir: null,
-
- init(extensionPath) {
- log.debug("init");
- this._extensionPath = extensionPath;
- },
-
- /**
- * Load specified sets, execute all combinations of them, and capture screenshots.
- */
- start: Task.async(function*(setNames, jobName = null) {
- let subDirs = ["mozscreenshots",
- (new Date()).toISOString().replace(/:/g, "-") + "_" + Services.appinfo.OS];
- let screenshotPath = FileUtils.getFile("TmpD", subDirs).path;
-
- const MOZ_UPLOAD_DIR = env.get("MOZ_UPLOAD_DIR");
- if (MOZ_UPLOAD_DIR) {
- screenshotPath = MOZ_UPLOAD_DIR;
- }
-
- log.info("Saving screenshots to:", screenshotPath);
-
- let screenshotPrefix = Services.appinfo.appBuildID;
- if (jobName) {
- screenshotPrefix += "-" + jobName;
- }
- screenshotPrefix += "_";
- Screenshot.init(screenshotPath, this._extensionPath, screenshotPrefix);
- this._libDir = this._extensionPath.QueryInterface(Ci.nsIFileURL).file.clone();
- this._libDir.append("chrome");
- this._libDir.append("mozscreenshots");
- this._libDir.append("lib");
-
- let sets = this.loadSets(setNames);
-
- log.info(sets.length + " sets:", setNames);
- this.combos = new LazyProduct(sets);
- log.info(this.combos.length + " combinations");
-
- this.currentComboIndex = this.completedCombos = 0;
- this._lastCombo = null;
-
- // Setup some prefs
- Services.prefs.setCharPref("browser.aboutHomeSnippets.updateUrl",
- "data:text/html;charset=utf-8,Generated by mozscreenshots");
- Services.prefs.setCharPref("extensions.ui.lastCategory", "addons://list/extension");
- // Don't let the caret blink since it causes false positives for image diffs
- Services.prefs.setIntPref("ui.caretBlinkTime", -1);
-
- let browserWindow = Services.wm.getMostRecentWindow("navigator:browser");
- let selectedBrowser = browserWindow.gBrowser.selectedBrowser;
- yield BrowserTestUtils.loadURI(selectedBrowser, HOME_PAGE);
- yield BrowserTestUtils.browserLoaded(selectedBrowser);
-
- for (let i = 0; i < this.combos.length; i++) {
- this.currentComboIndex = i;
- yield this._performCombo(this.combos.item(this.currentComboIndex));
- }
-
- log.info("Done: Completed " + this.completedCombos + " out of " +
- this.combos.length + " configurations.");
- this.cleanup();
- }),
-
- /**
- * Load sets of configurations from JSMs.
- * @param {String[]} setNames - array of set names (e.g. ["Tabs", "WindowSize"].
- * @return {Object[]} Array of sets containing `name` and `configurations` properties.
- */
- loadSets(setNames) {
- let sets = [];
- for (let setName of setNames) {
- try {
- let imported = {};
- Cu.import("chrome://mozscreenshots/content/configurations/" + setName + ".jsm",
- imported);
- imported[setName].init(this._libDir);
- let configurationNames = Object.keys(imported[setName].configurations);
- if (!configurationNames.length) {
- throw new Error(setName + " has no configurations for this environment");
- }
- for (let config of configurationNames) {
- // Automatically set the name property of the configuration object to
- // its name from the configuration object.
- imported[setName].configurations[config].name = config;
- }
- sets.push(imported[setName].configurations);
- } catch (ex) {
- log.error("Error loading set: " + setName);
- log.error(ex);
- throw ex;
- }
- }
- return sets;
- },
-
- cleanup() {
- let browserWindow = Services.wm.getMostRecentWindow("navigator:browser");
- let gBrowser = browserWindow.gBrowser;
- while (gBrowser.tabs.length > 1) {
- gBrowser.removeTab(gBrowser.selectedTab, {animate: false});
- }
- gBrowser.unpinTab(gBrowser.selectedTab);
- gBrowser.selectedBrowser.loadURI("data:text/html;charset=utf-8,
Done!");
- browserWindow.restore();
- },
-
- // helpers
-
- _performCombo: function*(combo) {
- let paddedComboIndex = padLeft(this.currentComboIndex + 1, String(this.combos.length).length);
- log.info("Combination " + paddedComboIndex + "/" + this.combos.length + ": " +
- this._comboName(combo).substring(1));
-
- function changeConfig(config) {
- log.debug("calling " + config.name);
- let applyPromise = Promise.resolve(config.applyConfig());
- let timeoutPromise = new Promise((resolve, reject) => {
- setTimeout(reject, APPLY_CONFIG_TIMEOUT_MS, "Timed out");
- });
- log.debug("called " + config.name);
- // Add a default timeout of 500ms to avoid conflicts when configurations
- // try to apply at the same time. e.g WindowSize and TabsInTitlebar
- return Promise.race([applyPromise, timeoutPromise]).then(() => {
- return new Promise((resolve) => {
- setTimeout(resolve, 500);
- });
- });
- }
-
- try {
- // First go through and actually apply all of the configs
- for (let i = 0; i < combo.length; i++) {
- let config = combo[i];
- if (!this._lastCombo || config !== this._lastCombo[i]) {
- log.debug("promising", config.name);
- yield changeConfig(config);
- }
- }
-
- // Update the lastCombo since it's now been applied regardless of whether it's accepted below.
- log.debug("fulfilled all applyConfig so setting lastCombo.");
- this._lastCombo = combo;
-
- // Then ask configs if the current setup is valid. We can't can do this in
- // the applyConfig methods of the config since it doesn't know what configs
- // later in the loop will do that may invalidate the combo.
- for (let i = 0; i < combo.length; i++) {
- let config = combo[i];
- // A configuration can specify an optional verifyConfig method to indicate
- // if the current config is valid for a screenshot. This gets called even
- // if the this config was used in the lastCombo since another config may
- // have invalidated it.
- if (config.verifyConfig) {
- log.debug("checking if the combo is valid with", config.name);
- yield config.verifyConfig();
- }
- }
- } catch (ex) {
- log.warn("\tskipped configuration: " + ex);
- // Don't set lastCombo here so that we properly know which configurations
- // need to be applied since the last screenshot
-
- // Return so we don't take a screenshot.
- return;
- }
-
- yield this._onConfigurationReady(combo);
- },
-
- _onConfigurationReady(combo) {
- let delayedScreenshot = () => {
- let filename = padLeft(this.currentComboIndex + 1,
- String(this.combos.length).length) + this._comboName(combo);
- return Screenshot.captureExternal(filename)
- .then(() => {
- this.completedCombos++;
- });
- };
-
- log.debug("_onConfigurationReady");
- return Task.spawn(delayedScreenshot);
- },
-
- _comboName(combo) {
- return combo.reduce(function(a, b) {
- return a + "_" + b.name;
- }, "");
- },
-};
-
-/**
- * Helper to lazily compute the Cartesian product of all of the sets of configurations.
- **/
-function LazyProduct(sets) {
- /**
- * An entry for each set with the value being:
- * [the number of permutations of the sets with lower index,
- * the number of items in the set at the index]
- */
- this.sets = sets;
- this.lookupTable = [];
- let combinations = 1;
- for (let i = this.sets.length - 1; i >= 0; i--) {
- let set = this.sets[i];
- let setLength = Object.keys(set).length;
- this.lookupTable[i] = [combinations, setLength];
- combinations *= setLength;
- }
-}
-LazyProduct.prototype = {
- get length() {
- let last = this.lookupTable[0];
- if (!last)
- return 0;
- return last[0] * last[1];
- },
-
- item(n) {
- // For set i, get the item from the set with the floored value of
- // (n / the number of permutations of the sets already chosen from) modulo the length of set i
- let result = [];
- for (let i = this.sets.length - 1; i >= 0; i--) {
- let priorCombinations = this.lookupTable[i][0];
- let setLength = this.lookupTable[i][1];
- let keyIndex = Math.floor(n / priorCombinations) % setLength;
- let keys = Object.keys(this.sets[i]);
- result[i] = this.sets[i][keys[keyIndex]];
- }
- return result;
- },
-};
-
-function padLeft(number, width, padding = "0") {
- return padding.repeat(Math.max(0, width - String(number).length)) + number;
-}
diff --git a/application/basilisk/tools/mozscreenshots/mozscreenshots/extension/bootstrap.js b/application/basilisk/tools/mozscreenshots/mozscreenshots/extension/bootstrap.js
deleted file mode 100644
index c7e238606d..0000000000
--- a/application/basilisk/tools/mozscreenshots/mozscreenshots/extension/bootstrap.js
+++ /dev/null
@@ -1,65 +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/. */
-/*
-#if 0
-Workaround a build system bug where this file doesn't get packaged if not pre-processed.
-#endif
-*/
-
-/* exported install, uninstall, startup, shutdown */
-
-"use strict";
-
-const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/AddonManager.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Timer.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "TestRunner",
- "chrome://mozscreenshots/content/TestRunner.jsm");
-
-function install(data, reason) {
- if (!isAppSupported()) {
- uninstallExtension(data);
- return;
- }
-
- AddonManager.getAddonByID(data.id, function(addon) {
- // Enable on install in case the user disabled a prior version
- if (addon) {
- addon.userDisabled = false;
- }
- });
-}
-
-function startup(data, reason) {
- if (!isAppSupported()) {
- uninstallExtension(data);
- return;
- }
-
- AddonManager.getAddonByID(data.id, function(addon) {
- let extensionPath = addon.getResourceURI();
- TestRunner.init(extensionPath);
- });
-}
-
-function shutdown(data, reason) { }
-
-function uninstall(data, reason) { }
-
-/**
- * @return boolean whether the test suite applies to the application.
- */
-function isAppSupported() {
- return true;
-}
-
-function uninstallExtension(data) {
- AddonManager.getAddonByID(data.id, function(addon) {
- addon.uninstall();
- });
-}
diff --git a/application/basilisk/tools/mozscreenshots/mozscreenshots/extension/configurations/AppMenu.jsm b/application/basilisk/tools/mozscreenshots/mozscreenshots/extension/configurations/AppMenu.jsm
deleted file mode 100644
index 5dbb2c1e2e..0000000000
--- a/application/basilisk/tools/mozscreenshots/mozscreenshots/extension/configurations/AppMenu.jsm
+++ /dev/null
@@ -1,84 +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/. */
-
-"use strict";
-
-this.EXPORTED_SYMBOLS = ["AppMenu"];
-
-const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-
-this.AppMenu = {
-
- init(libDir) {},
-
- configurations: {
- appMenuClosed: {
- applyConfig: Task.async(function*() {
- let browserWindow = Services.wm.getMostRecentWindow("navigator:browser");
- browserWindow.PanelUI.hide();
- }),
- },
-
- appMenuMainView: {
- applyConfig() {
- let browserWindow = Services.wm.getMostRecentWindow("navigator:browser");
- let promise = browserWindow.PanelUI.show();
- browserWindow.PanelUI.showMainView();
- return promise;
- },
- },
-
- appMenuHistorySubview: {
- applyConfig() {
- // History has a footer
- if (isCustomizing()) {
- return Promise.reject("Can't show subviews while customizing");
- }
- let browserWindow = Services.wm.getMostRecentWindow("navigator:browser");
- let promise = browserWindow.PanelUI.show();
- return promise.then(() => {
- browserWindow.PanelUI.showMainView();
- browserWindow.document.getElementById("history-panelmenu").click();
- });
- },
-
- verifyConfig: verifyConfigHelper,
- },
-
- appMenuHelpSubview: {
- applyConfig() {
- if (isCustomizing()) {
- return Promise.reject("Can't show subviews while customizing");
- }
- let browserWindow = Services.wm.getMostRecentWindow("navigator:browser");
- let promise = browserWindow.PanelUI.show();
- return promise.then(() => {
- browserWindow.PanelUI.showMainView();
- browserWindow.document.getElementById("PanelUI-help").click();
- });
- },
-
- verifyConfig: verifyConfigHelper,
- },
-
- },
-};
-
-function verifyConfigHelper() {
- if (isCustomizing()) {
- return Promise.reject("AppMenu verifyConfigHelper");
- }
- return Promise.resolve("AppMenu verifyConfigHelper");
-}
-
-function isCustomizing() {
- let browserWindow = Services.wm.getMostRecentWindow("navigator:browser");
- if (browserWindow.document.documentElement.hasAttribute("customizing")) {
- return true;
- }
- return false;
-}
diff --git a/application/basilisk/tools/mozscreenshots/mozscreenshots/extension/configurations/Buttons.jsm b/application/basilisk/tools/mozscreenshots/mozscreenshots/extension/configurations/Buttons.jsm
deleted file mode 100644
index 97d8354d5b..0000000000
--- a/application/basilisk/tools/mozscreenshots/mozscreenshots/extension/configurations/Buttons.jsm
+++ /dev/null
@@ -1,85 +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/. */
-
-"use strict";
-
-this.EXPORTED_SYMBOLS = ["Buttons"];
-
-const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
-Cu.import("resource:///modules/CustomizableUI.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-
-this.Buttons = {
-
- init(libDir) {
- createWidget();
- },
-
- configurations: {
- navBarButtons: {
- applyConfig: Task.async(() => {
- CustomizableUI.addWidgetToArea("screenshot-widget", CustomizableUI.AREA_NAVBAR);
- }),
- },
-
- tabsToolbarButtons: {
- applyConfig: Task.async(() => {
- CustomizableUI.addWidgetToArea("screenshot-widget", CustomizableUI.AREA_TABSTRIP);
- }),
- },
-
- menuPanelButtons: {
- applyConfig: Task.async(() => {
- CustomizableUI.addWidgetToArea("screenshot-widget", CustomizableUI.AREA_PANEL);
- }),
-
- verifyConfig() {
- let browserWindow = Services.wm.getMostRecentWindow("navigator:browser");
- if (browserWindow.PanelUI.panel.state == "closed") {
- return Promise.reject("The button isn't shown when the panel isn't open.");
- }
- return Promise.resolve("menuPanelButtons.verifyConfig");
- },
- },
-
- custPaletteButtons: {
- applyConfig: Task.async(() => {
- CustomizableUI.removeWidgetFromArea("screenshot-widget");
- }),
-
- verifyConfig() {
- let browserWindow = Services.wm.getMostRecentWindow("navigator:browser");
- if (browserWindow.document.documentElement.getAttribute("customizing") != "true") {
- return Promise.reject("The button isn't shown when we're not in customize mode.");
- }
- return Promise.resolve("custPaletteButtons.verifyConfig");
- },
- },
- },
-};
-
-function createWidget() {
- let id = "screenshot-widget";
- let spec = {
- id: id,
- label: "My Button",
- removable: true,
- tooltiptext: "",
- type: "button",
- };
- CustomizableUI.createWidget(spec);
-
- // Append a