commit 139d70e87f421a44fe017c09fd9f2119fcc78f8d Author: Kathy Brade brade@pearlcrescent.com Date: Tue Feb 26 10:07:17 2019 -0500
Bug 28044: Integrate Tor Launcher into tor-browser
Build and package Tor Launcher as part of the browser (similar to how pdfjs is handled).
If a Tor Launcher extension is present in the user's profile, it is removed. --- browser/extensions/moz.build | 3 +++ browser/installer/package-manifest.in | 5 +++++ toolkit/mozapps/extensions/internal/XPIProvider.jsm | 10 ++++++++++ 3 files changed, 18 insertions(+)
diff --git a/browser/extensions/moz.build b/browser/extensions/moz.build index 0eb3c53e76c2..df98fa94f629 100644 --- a/browser/extensions/moz.build +++ b/browser/extensions/moz.build @@ -5,3 +5,6 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/.
DIRS += ["doh-rollout", "formautofill", "screenshots", "webcompat", "report-site-issue"] + +if not CONFIG["TOR_BROWSER_DISABLE_TOR_LAUNCHER"]: + DIRS += ["tor-launcher"] diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in index a5148a03f0a6..30b88fc38277 100644 --- a/browser/installer/package-manifest.in +++ b/browser/installer/package-manifest.in @@ -255,6 +255,11 @@ @RESPATH@/browser/chrome/browser.manifest @RESPATH@/chrome/pdfjs.manifest @RESPATH@/chrome/pdfjs/* +#ifndef TOR_BROWSER_DISABLE_TOR_LAUNCHER +@RESPATH@/browser/chrome/torlauncher.manifest +@RESPATH@/browser/chrome/torlauncher/* +@RESPATH@/browser/@PREF_DIR@/torlauncher-prefs.js +#endif @RESPATH@/chrome/toolkit@JAREXT@ @RESPATH@/chrome/toolkit.manifest @RESPATH@/chrome/recording.manifest diff --git a/toolkit/mozapps/extensions/internal/XPIProvider.jsm b/toolkit/mozapps/extensions/internal/XPIProvider.jsm index ac5bdacb6de9..d1ed386fe676 100644 --- a/toolkit/mozapps/extensions/internal/XPIProvider.jsm +++ b/toolkit/mozapps/extensions/internal/XPIProvider.jsm @@ -1469,6 +1469,16 @@ var XPIStates = { for (let [id, file] of loc.readAddons()) { knownIds.delete(id);
+ // Since it is now part of the browser, uninstall the Tor Launcher + // extension. This will remove the Tor Launcher .xpi from user + // profiles on macOS. + if (id === "tor-launcher@torproject.org") { + logger.debug("Uninstalling the Tor Launcher extension."); + loc.installer.uninstallAddon(id); + changed = true; + continue; + } + let xpiState = loc.get(id); if (!xpiState) { // If the location is not supported for sideloading, skip new