tbb-commits
Threads by month
- ----- 2025 -----
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
May 2021
- 4 participants
- 352 discussions

[Git][tpo/applications/android-components][android-components-74.0.13-10.0-1] 12 commits: Bug 40005: Modify Default toolbar menu
by Matthew Finkel (@sysrqb) 05 May '21
by Matthew Finkel (@sysrqb) 05 May '21
05 May '21
Matthew Finkel pushed to branch android-components-74.0.13-10.0-1 at The Tor Project / Applications / android-components
Commits:
b0a0a870 by Matthew Finkel at 2021-05-04T22:27:37+00:00
Bug 40005: Modify Default toolbar menu
- - - - -
a02d6ae1 by Alex Catarineu at 2021-05-04T22:27:37+00:00
Bug 40007: Port external helper app prompting
Together with the corresponding fenix patch, this allows all `startActivity`
that may open external apps to be replaced by `TorUtils.startActivityPrompt`.
- - - - -
1a7ae200 by Alex Catarineu at 2021-05-04T22:27:37+00:00
Bug 40002: Ensure system download manager is not used
- - - - -
eb56b18c by Alex Catarineu at 2021-05-04T22:27:37+00:00
Bug 40009: Change the default search engines
This matches the search engines from desktop, that is:
DDG as the default, then YouTube, Google, DDGOnion,
Startpage, Twitter, Wikipedia and Yahoo.
- - - - -
47468302 by Alex Catarineu at 2021-05-04T22:27:37+00:00
Modify Addon support
Bug 40011: Hide option for disallowing addons in private mode
Bug 40016: Allow inheriting from AddonCollectionProvider
This will allow implementing our own AddonsProvider in fenix.
- - - - -
0ddc5824 by Georg Koppen at 2021-05-04T22:27:37+00:00
Bug 40013: Add option do overwrite timestamp in extension version
- - - - -
063a7209 by Alex Catarineu at 2021-05-04T22:27:37+00:00
Bug 40015: Port padlock states for .onion services
- - - - -
6e2eae38 by Alex Catarineu at 2021-05-04T22:27:37+00:00
Bug 40021: Force telemetry=false in Fennec settings migration
- - - - -
e6eada7b by Alex Catarineu at 2021-05-04T22:27:37+00:00
Bug 40022: Migrate Tor security level from Fennec
- - - - -
716d0653 by Matthew Finkel at 2021-05-04T22:27:37+00:00
Modify Tracking Protection configuration
Bug 40020: Disable third-party cookies
Bug 40024: Disable tracking protection by default
- - - - -
ce4beeb8 by Matthew Finkel at 2021-05-04T22:27:37+00:00
Bug 40023: Stop PrivateNotificationService
- - - - -
52aebd05 by Matthew Finkel at 2021-05-04T22:27:43+00:00
Add support for new GeckoView interfaces
Bug 40006: Expose Security Level interface
Bug 40019: Expose spoofEnglish pref
Bug 34439: Isolate Icon loader on Android
- - - - -
30 changed files:
- build.gradle
- components/browser/engine-gecko-beta/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngine.kt
- components/browser/engine-gecko-beta/src/main/java/mozilla/components/browser/engine/gecko/fetch/GeckoViewFetchClient.kt
- components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngine.kt
- components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/fetch/GeckoViewFetchClient.kt
- components/browser/icons/src/main/java/mozilla/components/browser/icons/loader/HttpIconLoader.kt
- components/browser/menu/src/main/java/mozilla/components/browser/menu/WebExtensionBrowserMenuBuilder.kt
- components/browser/search/src/main/assets/search/list.json
- + components/browser/search/src/main/assets/searchplugins/ddg-onion.xml
- components/browser/search/src/main/assets/searchplugins/ddg.xml
- + components/browser/search/src/main/assets/searchplugins/startpage.xml
- + components/browser/search/src/main/assets/searchplugins/yahoo.xml
- components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/display/DisplayToolbar.kt
- components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/display/SiteSecurityIconView.kt
- components/browser/toolbar/src/main/res/drawable/mozac_ic_site_security.xml
- components/browser/toolbar/src/main/res/values/attrs_browser_toolbar.xml
- components/concept/engine/src/main/java/mozilla/components/concept/engine/EngineSession.kt
- components/concept/engine/src/main/java/mozilla/components/concept/engine/Settings.kt
- components/concept/fetch/src/main/java/mozilla/components/concept/fetch/Request.kt
- components/concept/toolbar/src/main/java/mozilla/components/concept/toolbar/Toolbar.kt
- components/feature/addons/src/main/java/mozilla/components/feature/addons/amo/AddonCollectionProvider.kt
- components/feature/addons/src/main/res/layout/mozac_feature_addons_fragment_dialog_addon_installed.xml
- components/feature/app-links/build.gradle
- components/feature/app-links/src/main/java/mozilla/components/feature/app/links/AppLinksFeature.kt
- components/feature/app-links/src/main/java/mozilla/components/feature/app/links/AppLinksUseCases.kt
- components/feature/contextmenu/src/main/java/mozilla/components/feature/contextmenu/ContextMenuCandidate.kt
- components/feature/downloads/build.gradle
- components/feature/downloads/src/main/java/mozilla/components/feature/downloads/AbstractFetchDownloadService.kt
- components/feature/downloads/src/main/java/mozilla/components/feature/downloads/DownloadsFeature.kt
- components/feature/privatemode/src/main/java/mozilla/components/feature/privatemode/notification/PrivateNotificationFeature.kt
The diff was not included because it is too large.
View it on GitLab: https://gitlab.torproject.org/tpo/applications/android-components/-/compare…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/android-components/-/compare…
You're receiving this email because of your account on gitlab.torproject.org.
1
0

[Git][tpo/applications/android-components][android-components-74.0.13-10.5-1] 12 commits: Bug 40005: Modify Default toolbar menu
by Matthew Finkel (@sysrqb) 05 May '21
by Matthew Finkel (@sysrqb) 05 May '21
05 May '21
Matthew Finkel pushed to branch android-components-74.0.13-10.5-1 at The Tor Project / Applications / android-components
Commits:
b0a0a870 by Matthew Finkel at 2021-05-04T22:27:37+00:00
Bug 40005: Modify Default toolbar menu
- - - - -
a02d6ae1 by Alex Catarineu at 2021-05-04T22:27:37+00:00
Bug 40007: Port external helper app prompting
Together with the corresponding fenix patch, this allows all `startActivity`
that may open external apps to be replaced by `TorUtils.startActivityPrompt`.
- - - - -
1a7ae200 by Alex Catarineu at 2021-05-04T22:27:37+00:00
Bug 40002: Ensure system download manager is not used
- - - - -
eb56b18c by Alex Catarineu at 2021-05-04T22:27:37+00:00
Bug 40009: Change the default search engines
This matches the search engines from desktop, that is:
DDG as the default, then YouTube, Google, DDGOnion,
Startpage, Twitter, Wikipedia and Yahoo.
- - - - -
47468302 by Alex Catarineu at 2021-05-04T22:27:37+00:00
Modify Addon support
Bug 40011: Hide option for disallowing addons in private mode
Bug 40016: Allow inheriting from AddonCollectionProvider
This will allow implementing our own AddonsProvider in fenix.
- - - - -
0ddc5824 by Georg Koppen at 2021-05-04T22:27:37+00:00
Bug 40013: Add option do overwrite timestamp in extension version
- - - - -
063a7209 by Alex Catarineu at 2021-05-04T22:27:37+00:00
Bug 40015: Port padlock states for .onion services
- - - - -
6e2eae38 by Alex Catarineu at 2021-05-04T22:27:37+00:00
Bug 40021: Force telemetry=false in Fennec settings migration
- - - - -
e6eada7b by Alex Catarineu at 2021-05-04T22:27:37+00:00
Bug 40022: Migrate Tor security level from Fennec
- - - - -
716d0653 by Matthew Finkel at 2021-05-04T22:27:37+00:00
Modify Tracking Protection configuration
Bug 40020: Disable third-party cookies
Bug 40024: Disable tracking protection by default
- - - - -
ce4beeb8 by Matthew Finkel at 2021-05-04T22:27:37+00:00
Bug 40023: Stop PrivateNotificationService
- - - - -
52aebd05 by Matthew Finkel at 2021-05-04T22:27:43+00:00
Add support for new GeckoView interfaces
Bug 40006: Expose Security Level interface
Bug 40019: Expose spoofEnglish pref
Bug 34439: Isolate Icon loader on Android
- - - - -
30 changed files:
- build.gradle
- components/browser/engine-gecko-beta/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngine.kt
- components/browser/engine-gecko-beta/src/main/java/mozilla/components/browser/engine/gecko/fetch/GeckoViewFetchClient.kt
- components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngine.kt
- components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/fetch/GeckoViewFetchClient.kt
- components/browser/icons/src/main/java/mozilla/components/browser/icons/loader/HttpIconLoader.kt
- components/browser/menu/src/main/java/mozilla/components/browser/menu/WebExtensionBrowserMenuBuilder.kt
- components/browser/search/src/main/assets/search/list.json
- + components/browser/search/src/main/assets/searchplugins/ddg-onion.xml
- components/browser/search/src/main/assets/searchplugins/ddg.xml
- + components/browser/search/src/main/assets/searchplugins/startpage.xml
- + components/browser/search/src/main/assets/searchplugins/yahoo.xml
- components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/display/DisplayToolbar.kt
- components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/display/SiteSecurityIconView.kt
- components/browser/toolbar/src/main/res/drawable/mozac_ic_site_security.xml
- components/browser/toolbar/src/main/res/values/attrs_browser_toolbar.xml
- components/concept/engine/src/main/java/mozilla/components/concept/engine/EngineSession.kt
- components/concept/engine/src/main/java/mozilla/components/concept/engine/Settings.kt
- components/concept/fetch/src/main/java/mozilla/components/concept/fetch/Request.kt
- components/concept/toolbar/src/main/java/mozilla/components/concept/toolbar/Toolbar.kt
- components/feature/addons/src/main/java/mozilla/components/feature/addons/amo/AddonCollectionProvider.kt
- components/feature/addons/src/main/res/layout/mozac_feature_addons_fragment_dialog_addon_installed.xml
- components/feature/app-links/build.gradle
- components/feature/app-links/src/main/java/mozilla/components/feature/app/links/AppLinksFeature.kt
- components/feature/app-links/src/main/java/mozilla/components/feature/app/links/AppLinksUseCases.kt
- components/feature/contextmenu/src/main/java/mozilla/components/feature/contextmenu/ContextMenuCandidate.kt
- components/feature/downloads/build.gradle
- components/feature/downloads/src/main/java/mozilla/components/feature/downloads/AbstractFetchDownloadService.kt
- components/feature/downloads/src/main/java/mozilla/components/feature/downloads/DownloadsFeature.kt
- components/feature/privatemode/src/main/java/mozilla/components/feature/privatemode/notification/PrivateNotificationFeature.kt
The diff was not included because it is too large.
View it on GitLab: https://gitlab.torproject.org/tpo/applications/android-components/-/compare…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/android-components/-/compare…
You're receiving this email because of your account on gitlab.torproject.org.
1
0

[Git][tpo/applications/android-components] Pushed new branch android-components-74.0.13-10.0-1
by Matthew Finkel (@sysrqb) 05 May '21
by Matthew Finkel (@sysrqb) 05 May '21
05 May '21
Matthew Finkel pushed new branch android-components-74.0.13-10.0-1 at The Tor Project / Applications / android-components
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/android-components/-/tree/an…
You're receiving this email because of your account on gitlab.torproject.org.
1
0

[Git][tpo/applications/android-components] Pushed new branch android-components-74.0.13-10.5-1
by Matthew Finkel (@sysrqb) 05 May '21
by Matthew Finkel (@sysrqb) 05 May '21
05 May '21
Matthew Finkel pushed new branch android-components-74.0.13-10.5-1 at The Tor Project / Applications / android-components
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/android-components/-/tree/an…
You're receiving this email because of your account on gitlab.torproject.org.
1
0
commit d6e9e4d906002979d6a0478cb8ee259e80d3996b
Author: Georg Koppen <gk(a)torproject.org>
Date: Wed May 5 11:43:42 2021 +0000
Pick up fix for rbm#40024
---
rbm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rbm b/rbm
index ac75418..b7f534d 160000
--- a/rbm
+++ b/rbm
@@ -1 +1 @@
-Subproject commit ac7541882a965a14107b7b7016f341605f405267
+Subproject commit b7f534d6bdbaba7ee83fdf8d7068ec349470e8c7
1
0

[rbm/master] Bug 40024: Only create source tarball after getting all input_files
by gk@torproject.org 05 May '21
by gk@torproject.org 05 May '21
05 May '21
commit b7f534d6bdbaba7ee83fdf8d7068ec349470e8c7
Author: Nicolas Vigier <boklm(a)torproject.org>
Date: Tue Apr 27 16:50:51 2021 +0200
Bug 40024: Only create source tarball after getting all input_files
---
lib/RBM.pm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/RBM.pm b/lib/RBM.pm
index d2aeab2..bc509cb 100644
--- a/lib/RBM.pm
+++ b/lib/RBM.pm
@@ -1033,10 +1033,10 @@ sub build_run {
. '/rbm-XXXXX');
my $srcdir = $tmpdir->dirname;
my @cfiles;
- my $tarfile = maketar($project, $options, $srcdir);
- push @cfiles, $tarfile if $tarfile;
push @cfiles, copy_files($project, $srcdir);
push @cfiles, input_files('copy', $project, $options, $srcdir);
+ my $tarfile = maketar($project, $options, $srcdir);
+ push @cfiles, $tarfile if $tarfile;
my ($remote_tmp_src, $remote_tmp_dst, %build_script);
my @scripts = ('pre', $script_name, 'post');
my %scripts_root = ( pre => 1, post => 1);
1
0

[Git][tpo/applications/fenix][tor-browser-88.1.1-10.5-1] Bug 40162: Disable Numbus experiments
by Matthew Finkel (@sysrqb) 04 May '21
by Matthew Finkel (@sysrqb) 04 May '21
04 May '21
Matthew Finkel pushed to branch tor-browser-88.1.1-10.5-1 at The Tor Project / Applications / fenix
Commits:
6fef40b9 by Matthew Finkel at 2021-05-03T23:11:47+00:00
Bug 40162: Disable Numbus experiments
- - - - -
1 changed file:
- app/src/main/java/org/mozilla/fenix/FeatureFlags.kt
Changes:
=====================================
app/src/main/java/org/mozilla/fenix/FeatureFlags.kt
=====================================
@@ -17,7 +17,7 @@ object FeatureFlags {
/**
* Enables the Nimbus experiments library.
*/
- const val nimbusExperiments = true
+ const val nimbusExperiments = false
/**
* Enables the Addresses autofill feature.
View it on GitLab: https://gitlab.torproject.org/tpo/applications/fenix/-/commit/6fef40b98ad50…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/fenix/-/commit/6fef40b98ad50…
You're receiving this email because of your account on gitlab.torproject.org.
1
0

[tor-browser/tor-browser-88.0.1-10.0-1] Bug 31286: Implementation of bridge, proxy, and firewall settings in about:preferences#tor
by sysrqb@torproject.org 04 May '21
by sysrqb@torproject.org 04 May '21
04 May '21
commit 59c4c25b796e86229be4efdd4e6a86ebe20b3236
Author: Richard Pospesel <richard(a)torproject.org>
Date: Mon Sep 16 15:25:39 2019 -0700
Bug 31286: Implementation of bridge, proxy, and firewall settings in about:preferences#tor
This patch adds a new about:preferences#tor page which allows modifying
bridge, proxy, and firewall settings from within Tor Browser. All of the
functionality present in tor-launcher's Network Configuration panel is
present:
- Setting built-in bridges
- Requesting bridges from BridgeDB via moat
- Using user-provided bridges
- Configuring SOCKS4, SOCKS5, and HTTP/HTTPS proxies
- Setting firewall ports
- Viewing and Copying Tor's logs
- The Networking Settings in General preferences has been removed
---
browser/components/moz.build | 1 +
browser/components/preferences/main.inc.xhtml | 55 --
browser/components/preferences/main.js | 14 -
browser/components/preferences/preferences.js | 9 +
browser/components/preferences/preferences.xhtml | 5 +
browser/components/preferences/privacy.js | 1 +
.../torpreferences/content/parseFunctions.jsm | 89 +++
.../torpreferences/content/requestBridgeDialog.jsm | 204 +++++
.../content/requestBridgeDialog.xhtml | 35 +
.../torpreferences/content/torBridgeSettings.jsm | 325 ++++++++
.../torpreferences/content/torCategory.inc.xhtml | 9 +
.../torpreferences/content/torFirewallSettings.jsm | 72 ++
.../torpreferences/content/torLogDialog.jsm | 66 ++
.../torpreferences/content/torLogDialog.xhtml | 23 +
.../components/torpreferences/content/torPane.js | 857 +++++++++++++++++++++
.../torpreferences/content/torPane.xhtml | 123 +++
.../torpreferences/content/torPreferences.css | 77 ++
.../torpreferences/content/torPreferencesIcon.svg | 5 +
.../torpreferences/content/torProxySettings.jsm | 245 ++++++
browser/components/torpreferences/jar.mn | 14 +
browser/components/torpreferences/moz.build | 1 +
browser/modules/BridgeDB.jsm | 110 +++
browser/modules/TorProtocolService.jsm | 212 +++++
browser/modules/moz.build | 2 +
24 files changed, 2485 insertions(+), 69 deletions(-)
diff --git a/browser/components/moz.build b/browser/components/moz.build
index ef09055b990a..e99fa19d896a 100644
--- a/browser/components/moz.build
+++ b/browser/components/moz.build
@@ -55,6 +55,7 @@ DIRS += [
"syncedtabs",
"uitour",
"urlbar",
+ "torpreferences",
"translation",
]
diff --git a/browser/components/preferences/main.inc.xhtml b/browser/components/preferences/main.inc.xhtml
index 2d55e165c5ba..78d0cea8b8a2 100644
--- a/browser/components/preferences/main.inc.xhtml
+++ b/browser/components/preferences/main.inc.xhtml
@@ -665,59 +665,4 @@
<label id="cfrFeaturesLearnMore" class="learnMore" data-l10n-id="browsing-cfr-recommendations-learn-more" is="text-link"/>
</hbox>
</groupbox>
-
-<hbox id="networkProxyCategory"
- class="subcategory"
- hidden="true"
- data-category="paneGeneral">
- <html:h1 data-l10n-id="network-settings-title"/>
-</hbox>
-
-<!-- Network Settings-->
-<groupbox id="connectionGroup" data-category="paneGeneral" hidden="true">
- <label class="search-header" hidden="true"><html:h2 data-l10n-id="network-settings-title"/></label>
-
- <hbox align="center">
- <hbox align="center" flex="1">
- <description id="connectionSettingsDescription" control="connectionSettings"/>
- <spacer width="5"/>
- <label id="connectionSettingsLearnMore" class="learnMore" is="text-link"
- data-l10n-id="network-proxy-connection-learn-more">
- </label>
- <separator orient="vertical"/>
- </hbox>
-
- <!-- Please don't remove the wrapping hbox/vbox/box for these elements. It's used to properly compute the search tooltip position. -->
- <hbox>
- <button id="connectionSettings"
- is="highlightable-button"
- class="accessory-button"
- data-l10n-id="network-proxy-connection-settings"
- searchkeywords="doh trr"
- search-l10n-ids="
- connection-window.title,
- connection-proxy-option-no.label,
- connection-proxy-option-auto.label,
- connection-proxy-option-system.label,
- connection-proxy-option-manual.label,
- connection-proxy-http,
- connection-proxy-https,
- connection-proxy-ftp,
- connection-proxy-http-port,
- connection-proxy-socks,
- connection-proxy-socks4,
- connection-proxy-socks5,
- connection-proxy-noproxy,
- connection-proxy-noproxy-desc,
- connection-proxy-http-sharing.label,
- connection-proxy-autotype.label,
- connection-proxy-reload.label,
- connection-proxy-autologin.label,
- connection-proxy-socks-remote-dns.label,
- connection-dns-over-https.label,
- connection-dns-over-https-url-custom.label,
- " />
- </hbox>
- </hbox>
-</groupbox>
</html:template>
diff --git a/browser/components/preferences/main.js b/browser/components/preferences/main.js
index b5a192fc274a..6daf5b329878 100644
--- a/browser/components/preferences/main.js
+++ b/browser/components/preferences/main.js
@@ -364,15 +364,6 @@ var gMainPane = {
});
this.updatePerformanceSettingsBox({ duringChangeEvent: false });
this.displayUseSystemLocale();
- let connectionSettingsLink = document.getElementById(
- "connectionSettingsLearnMore"
- );
- let connectionSettingsUrl =
- Services.urlFormatter.formatURLPref("app.support.baseURL") +
- "prefs-connection-settings";
- connectionSettingsLink.setAttribute("href", connectionSettingsUrl);
- this.updateProxySettingsUI();
- initializeProxyUI(gMainPane);
if (Services.prefs.getBoolPref("intl.multilingual.enabled")) {
gMainPane.initBrowserLocale();
@@ -506,11 +497,6 @@ var gMainPane = {
"change",
gMainPane.updateHardwareAcceleration.bind(gMainPane)
);
- setEventListener(
- "connectionSettings",
- "command",
- gMainPane.showConnections
- );
setEventListener(
"browserContainersCheckbox",
"command",
diff --git a/browser/components/preferences/preferences.js b/browser/components/preferences/preferences.js
index 91e9e469cea2..a89fddd0306d 100644
--- a/browser/components/preferences/preferences.js
+++ b/browser/components/preferences/preferences.js
@@ -13,6 +13,7 @@
/* import-globals-from findInPage.js */
/* import-globals-from ../../base/content/utilityOverlay.js */
/* import-globals-from ../../../toolkit/content/preferencesBindings.js */
+/* import-globals-from ../torpreferences/content/torPane.js */
"use strict";
@@ -136,6 +137,14 @@ function init_all() {
register_module("paneSync", gSyncPane);
}
register_module("paneSearchResults", gSearchResultsPane);
+ if (gTorPane.enabled) {
+ document.getElementById("category-tor").hidden = false;
+ register_module("paneTor", gTorPane);
+ } else {
+ // Remove the pane from the DOM so it doesn't get incorrectly included in search results.
+ document.getElementById("template-paneTor").remove();
+ }
+
gSearchResultsPane.init();
gMainPane.preInit();
diff --git a/browser/components/preferences/preferences.xhtml b/browser/components/preferences/preferences.xhtml
index c1322ea10357..fd4098471966 100644
--- a/browser/components/preferences/preferences.xhtml
+++ b/browser/components/preferences/preferences.xhtml
@@ -13,6 +13,7 @@
<?xml-stylesheet href="chrome://browser/skin/preferences/containers.css"?>
<?xml-stylesheet href="chrome://browser/skin/preferences/privacy.css"?>
<?xml-stylesheet href="chrome://browser/content/securitylevel/securityLevelPreferences.css"?>
+<?xml-stylesheet href="chrome://browser/content/torpreferences/torPreferences.css"?>
<!DOCTYPE html [
<!ENTITY % aboutTorDTD SYSTEM "chrome://torbutton/locale/aboutTor.dtd">
@@ -155,6 +156,9 @@
<image class="category-icon"/>
<label class="category-name" flex="1" data-l10n-id="pane-experimental-title"></label>
</richlistitem>
+
+#include ../torpreferences/content/torCategory.inc.xhtml
+
</richlistbox>
<spacer flex="1"/>
@@ -208,6 +212,7 @@
#include containers.inc.xhtml
#include sync.inc.xhtml
#include experimental.inc.xhtml
+#include ../torpreferences/content/torPane.xhtml
</vbox>
</vbox>
</vbox>
diff --git a/browser/components/preferences/privacy.js b/browser/components/preferences/privacy.js
index 8401d4d101e4..1c5f31934d82 100644
--- a/browser/components/preferences/privacy.js
+++ b/browser/components/preferences/privacy.js
@@ -80,6 +80,7 @@ XPCOMUtils.defineLazyGetter(this, "AlertsServiceDND", function() {
}
});
+// TODO: module import via ChromeUtils.defineModuleGetter
XPCOMUtils.defineLazyScriptGetter(
this,
["SecurityLevelPreferences"],
diff --git a/browser/components/torpreferences/content/parseFunctions.jsm b/browser/components/torpreferences/content/parseFunctions.jsm
new file mode 100644
index 000000000000..954759de63a5
--- /dev/null
+++ b/browser/components/torpreferences/content/parseFunctions.jsm
@@ -0,0 +1,89 @@
+"use strict";
+
+var EXPORTED_SYMBOLS = [
+ "parsePort",
+ "parseAddrPort",
+ "parseUsernamePassword",
+ "parseAddrPortList",
+ "parseBridgeStrings",
+ "parsePortList",
+];
+
+// expects a string representation of an integer from 1 to 65535
+let parsePort = function(aPort) {
+ // ensure port string is a valid positive integer
+ const validIntRegex = /^[0-9]+$/;
+ if (!validIntRegex.test(aPort)) {
+ throw new Error(`Invalid PORT string : '${aPort}'`);
+ }
+
+ // ensure port value is on valid range
+ let port = Number.parseInt(aPort);
+ if (port < 1 || port > 65535) {
+ throw new Error(
+ `Invalid PORT value, needs to be on range [1,65535] : '${port}'`
+ );
+ }
+
+ return port;
+};
+// expects a string in the format: "ADDRESS:PORT"
+let parseAddrPort = function(aAddrColonPort) {
+ let tokens = aAddrColonPort.split(":");
+ if (tokens.length != 2) {
+ throw new Error(`Invalid ADDRESS:PORT string : '${aAddrColonPort}'`);
+ }
+ let address = tokens[0];
+ let port = parsePort(tokens[1]);
+ return [address, port];
+};
+
+// expects a string in the format: "USERNAME:PASSWORD"
+// split on the first colon and any subsequent go into password
+let parseUsernamePassword = function(aUsernameColonPassword) {
+ let colonIndex = aUsernameColonPassword.indexOf(":");
+ if (colonIndex < 0) {
+ // we don't log the contents of the potentially password containing string
+ throw new Error("Invalid USERNAME:PASSWORD string");
+ }
+
+ let username = aUsernameColonPassword.substring(0, colonIndex);
+ let password = aUsernameColonPassword.substring(colonIndex + 1);
+
+ return [username, password];
+};
+
+// expects a string in the format: ADDRESS:PORT,ADDRESS:PORT,...
+// returns array of ports (as ints)
+let parseAddrPortList = function(aAddrPortList) {
+ let addrPorts = aAddrPortList.split(",");
+ // parse ADDRESS:PORT string and only keep the port (second element in returned array)
+ let retval = addrPorts.map(addrPort => parseAddrPort(addrPort)[1]);
+ return retval;
+};
+
+// expects a '/n' or '/r/n' delimited bridge string, which we split and trim
+// each bridge string can also optionally have 'bridge' at the beginning ie:
+// bridge $(type) $(address):$(port) $(certificate)
+// we strip out the 'bridge' prefix here
+let parseBridgeStrings = function(aBridgeStrings) {
+
+ // replace carriage returns ('\r') with new lines ('\n')
+ aBridgeStrings = aBridgeStrings.replace(/\r/g, "\n");
+ // then replace contiguous new lines ('\n') with a single one
+ aBridgeStrings = aBridgeStrings.replace(/[\n]+/g, "\n");
+
+ // split on the newline and for each bridge string: trim, remove starting 'bridge' string
+ // finally discard entries that are empty strings; empty strings could occur if we receive
+ // a new line containing only whitespace
+ let splitStrings = aBridgeStrings.split("\n");
+ return splitStrings.map(val => val.trim().replace(/^bridge\s+/i, ""))
+ .filter(bridgeString => bridgeString != "");
+};
+
+// expecting a ',' delimited list of ints with possible white space between
+// returns an array of ints
+let parsePortList = function(aPortListString) {
+ let splitStrings = aPortListString.split(",");
+ return splitStrings.map(val => parsePort(val.trim()));
+};
diff --git a/browser/components/torpreferences/content/requestBridgeDialog.jsm b/browser/components/torpreferences/content/requestBridgeDialog.jsm
new file mode 100644
index 000000000000..807d46cdfb18
--- /dev/null
+++ b/browser/components/torpreferences/content/requestBridgeDialog.jsm
@@ -0,0 +1,204 @@
+"use strict";
+
+var EXPORTED_SYMBOLS = ["RequestBridgeDialog"];
+
+const { BridgeDB } = ChromeUtils.import("resource:///modules/BridgeDB.jsm");
+const { TorStrings } = ChromeUtils.import("resource:///modules/TorStrings.jsm");
+
+class RequestBridgeDialog {
+ constructor() {
+ this._dialog = null;
+ this._submitButton = null;
+ this._dialogDescription = null;
+ this._captchaImage = null;
+ this._captchaEntryTextbox = null;
+ this._captchaRefreshButton = null;
+ this._incorrectCaptchaHbox = null;
+ this._incorrectCaptchaLabel = null;
+ this._bridges = [];
+ this._proxyURI = null;
+ }
+
+ static get selectors() {
+ return {
+ submitButton:
+ "accept" /* not really a selector but a key for dialog's getButton */,
+ dialogDescription: "description#torPreferences-requestBridge-description",
+ captchaImage: "image#torPreferences-requestBridge-captchaImage",
+ captchaEntryTextbox: "input#torPreferences-requestBridge-captchaTextbox",
+ refreshCaptchaButton:
+ "button#torPreferences-requestBridge-refreshCaptchaButton",
+ incorrectCaptchaHbox:
+ "hbox#torPreferences-requestBridge-incorrectCaptchaHbox",
+ incorrectCaptchaLabel:
+ "label#torPreferences-requestBridge-incorrectCaptchaError",
+ };
+ }
+
+ _populateXUL(dialog) {
+ const selectors = RequestBridgeDialog.selectors;
+
+ this._dialog = dialog;
+ const dialogWin = dialog.parentElement;
+ dialogWin.setAttribute(
+ "title",
+ TorStrings.settings.requestBridgeDialogTitle
+ );
+ // user may have opened a Request Bridge dialog in another tab, so update the
+ // CAPTCHA image or close out the dialog if we have a bridge list
+ this._dialog.addEventListener("focusin", () => {
+ const uri = BridgeDB.currentCaptchaImage;
+ const bridges = BridgeDB.currentBridges;
+
+ // new captcha image
+ if (uri) {
+ this._setcaptchaImage(uri);
+ } else if (bridges) {
+ this._bridges = bridges;
+ this._submitButton.disabled = false;
+ this._dialog.cancelDialog();
+ }
+ });
+
+ this._submitButton = this._dialog.getButton(selectors.submitButton);
+ this._submitButton.setAttribute("label", TorStrings.settings.submitCaptcha);
+ this._submitButton.disabled = true;
+ this._dialog.addEventListener("dialogaccept", e => {
+ e.preventDefault();
+ this.onSubmitCaptcha();
+ });
+
+ this._dialogDescription = this._dialog.querySelector(
+ selectors.dialogDescription
+ );
+ this._dialogDescription.textContent =
+ TorStrings.settings.contactingBridgeDB;
+
+ this._captchaImage = this._dialog.querySelector(selectors.captchaImage);
+
+ // request captcha from bridge db
+ BridgeDB.requestNewCaptchaImage(this._proxyURI).then(uri => {
+ this._setcaptchaImage(uri);
+ });
+
+ this._captchaEntryTextbox = this._dialog.querySelector(
+ selectors.captchaEntryTextbox
+ );
+ this._captchaEntryTextbox.setAttribute(
+ "placeholder",
+ TorStrings.settings.captchaTextboxPlaceholder
+ );
+ this._captchaEntryTextbox.disabled = true;
+ // disable submit if entry textbox is empty
+ this._captchaEntryTextbox.oninput = () => {
+ this._submitButton.disabled = this._captchaEntryTextbox.value == "";
+ };
+
+ this._captchaRefreshButton = this._dialog.querySelector(
+ selectors.refreshCaptchaButton
+ );
+ this._captchaRefreshButton.disabled = true;
+
+ this._incorrectCaptchaHbox = this._dialog.querySelector(
+ selectors.incorrectCaptchaHbox
+ );
+ this._incorrectCaptchaLabel = this._dialog.querySelector(
+ selectors.incorrectCaptchaLabel
+ );
+ this._incorrectCaptchaLabel.setAttribute(
+ "value",
+ TorStrings.settings.incorrectCaptcha
+ );
+
+ return true;
+ }
+
+ _setcaptchaImage(uri) {
+ if (uri != this._captchaImage.src) {
+ this._captchaImage.src = uri;
+ this._dialogDescription.textContent = TorStrings.settings.solveTheCaptcha;
+ this._setUIDisabled(false);
+ this._captchaEntryTextbox.focus();
+ this._captchaEntryTextbox.select();
+ }
+ }
+
+ _setUIDisabled(disabled) {
+ this._submitButton.disabled = this._captchaGuessIsEmpty() || disabled;
+ this._captchaEntryTextbox.disabled = disabled;
+ this._captchaRefreshButton.disabled = disabled;
+ }
+
+ _captchaGuessIsEmpty() {
+ return this._captchaEntryTextbox.value == "";
+ }
+
+ init(window, dialog) {
+ // defer to later until firefox has populated the dialog with all our elements
+ window.setTimeout(() => {
+ this._populateXUL(dialog);
+ }, 0);
+ }
+
+ close() {
+ BridgeDB.close();
+ }
+
+ /*
+ Event Handlers
+ */
+ onSubmitCaptcha() {
+ let captchaText = this._captchaEntryTextbox.value.trim();
+ // noop if the field is empty
+ if (captchaText == "") {
+ return;
+ }
+
+ // freeze ui while we make request
+ this._setUIDisabled(true);
+ this._incorrectCaptchaHbox.style.visibility = "hidden";
+
+ BridgeDB.submitCaptchaGuess(captchaText)
+ .then(aBridges => {
+ this._bridges = aBridges;
+
+ this._submitButton.disabled = false;
+ // This was successful, but use cancelDialog() to close, since
+ // we intercept the `dialogaccept` event.
+ this._dialog.cancelDialog();
+ })
+ .catch(aError => {
+ this._bridges = [];
+ this._setUIDisabled(false);
+ this._incorrectCaptchaHbox.style.visibility = "visible";
+ });
+ }
+
+ onRefreshCaptcha() {
+ this._setUIDisabled(true);
+ this._captchaImage.src = "";
+ this._dialogDescription.textContent =
+ TorStrings.settings.contactingBridgeDB;
+ this._captchaEntryTextbox.value = "";
+ this._incorrectCaptchaHbox.style.visibility = "hidden";
+
+ BridgeDB.requestNewCaptchaImage(this._proxyURI).then(uri => {
+ this._setcaptchaImage(uri);
+ });
+ }
+
+ openDialog(gSubDialog, aProxyURI, aCloseCallback) {
+ this._proxyURI = aProxyURI;
+ gSubDialog.open(
+ "chrome://browser/content/torpreferences/requestBridgeDialog.xhtml",
+ {
+ features: "resizable=yes",
+ closingCallback: () => {
+ this.close();
+ aCloseCallback(this._bridges);
+ }
+ },
+ this,
+ );
+ }
+}
diff --git a/browser/components/torpreferences/content/requestBridgeDialog.xhtml b/browser/components/torpreferences/content/requestBridgeDialog.xhtml
new file mode 100644
index 000000000000..64c4507807fb
--- /dev/null
+++ b/browser/components/torpreferences/content/requestBridgeDialog.xhtml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+<?xml-stylesheet href="chrome://browser/skin/preferences/preferences.css"?>
+<?xml-stylesheet href="chrome://browser/content/torpreferences/torPreferences.css"?>
+
+<window type="child"
+ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+ xmlns:html="http://www.w3.org/1999/xhtml">
+<dialog id="torPreferences-requestBridge-dialog"
+ buttons="accept,cancel">
+ <!-- ok, so ​ is a zero-width space. We need to have *something* in the innerText so that XUL knows how tall the
+ description node is so that it can determine how large to make the dialog element's inner draw area. If we have
+ nothing in the innerText, then it collapse to 0 height, and the contents of the dialog ends up partially hidden >:( -->
+ <description id="torPreferences-requestBridge-description">​</description>
+ <!-- init to transparent 400x125 png -->
+ <image id="torPreferences-requestBridge-captchaImage" flex="1"/>
+ <hbox id="torPreferences-requestBridge-inputHbox">
+ <html:input id="torPreferences-requestBridge-captchaTextbox" type="text" style="-moz-box-flex: 1;"/>
+ <button id="torPreferences-requestBridge-refreshCaptchaButton"
+ image="chrome://browser/skin/reload.svg"
+ oncommand="requestBridgeDialog.onRefreshCaptcha();"/>
+ </hbox>
+ <hbox id="torPreferences-requestBridge-incorrectCaptchaHbox" align="center">
+ <image id="torPreferences-requestBridge-errorIcon" />
+ <label id="torPreferences-requestBridge-incorrectCaptchaError" flex="1"/>
+ </hbox>
+ <script type="application/javascript"><![CDATA[
+ "use strict";
+
+ let requestBridgeDialog = window.arguments[0];
+ let dialog = document.getElementById("torPreferences-requestBridge-dialog");
+ requestBridgeDialog.init(window, dialog);
+ ]]></script>
+</dialog>
+</window>
\ No newline at end of file
diff --git a/browser/components/torpreferences/content/torBridgeSettings.jsm b/browser/components/torpreferences/content/torBridgeSettings.jsm
new file mode 100644
index 000000000000..ceb61d3ec972
--- /dev/null
+++ b/browser/components/torpreferences/content/torBridgeSettings.jsm
@@ -0,0 +1,325 @@
+"use strict";
+
+var EXPORTED_SYMBOLS = [
+ "TorBridgeSource",
+ "TorBridgeSettings",
+ "makeTorBridgeSettingsNone",
+ "makeTorBridgeSettingsBuiltin",
+ "makeTorBridgeSettingsBridgeDB",
+ "makeTorBridgeSettingsUserProvided",
+];
+
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { TorProtocolService } = ChromeUtils.import(
+ "resource:///modules/TorProtocolService.jsm"
+);
+const { TorStrings } = ChromeUtils.import("resource:///modules/TorStrings.jsm");
+
+const TorBridgeSource = {
+ NONE: "NONE",
+ BUILTIN: "BUILTIN",
+ BRIDGEDB: "BRIDGEDB",
+ USERPROVIDED: "USERPROVIDED",
+};
+
+class TorBridgeSettings {
+ constructor() {
+ this._bridgeSource = TorBridgeSource.NONE;
+ this._selectedDefaultBridgeType = null;
+ this._bridgeStrings = [];
+ }
+
+ get selectedDefaultBridgeType() {
+ if (this._bridgeSource == TorBridgeSource.BUILTIN) {
+ return this._selectedDefaultBridgeType;
+ }
+ return undefined;
+ }
+
+ get bridgeSource() {
+ return this._bridgeSource;
+ }
+
+ // for display
+ get bridgeStrings() {
+ return this._bridgeStrings.join("\n");
+ }
+
+ // raw
+ get bridgeStringsArray() {
+ return this._bridgeStrings;
+ }
+
+ static get defaultBridgeTypes() {
+ if (TorBridgeSettings._defaultBridgeTypes) {
+ return TorBridgeSettings._defaultBridgeTypes;
+ }
+
+ let bridgeListBranch = Services.prefs.getBranch(
+ TorStrings.preferenceBranches.defaultBridge
+ );
+ let bridgePrefs = bridgeListBranch.getChildList("", {});
+
+ // an unordered set for shoving bridge types into
+ let bridgeTypes = new Set();
+ // look for keys ending in ".N" and treat string before that as the bridge type
+ const pattern = /\.[0-9]+$/;
+ for (const key of bridgePrefs) {
+ const offset = key.search(pattern);
+ if (offset != -1) {
+ const bt = key.substring(0, offset);
+ bridgeTypes.add(bt);
+ }
+ }
+
+ // recommended bridge type goes first in the list
+ let recommendedBridgeType = Services.prefs.getCharPref(
+ TorStrings.preferenceKeys.recommendedBridgeType,
+ null
+ );
+
+ let retval = [];
+ if (recommendedBridgeType && bridgeTypes.has(recommendedBridgeType)) {
+ retval.push(recommendedBridgeType);
+ }
+
+ for (const bridgeType of bridgeTypes.values()) {
+ if (bridgeType != recommendedBridgeType) {
+ retval.push(bridgeType);
+ }
+ }
+
+ // cache off
+ TorBridgeSettings._defaultBridgeTypes = retval;
+ return retval;
+ }
+
+ _readDefaultBridges(aBridgeType) {
+ let bridgeBranch = Services.prefs.getBranch(
+ TorStrings.preferenceBranches.defaultBridge
+ );
+ let bridgeBranchPrefs = bridgeBranch.getChildList("", {});
+
+ let retval = [];
+
+ // regex matches against strings ending in ".N" where N is a positive integer
+ let pattern = /\.[0-9]+$/;
+ for (const key of bridgeBranchPrefs) {
+ // verify the location of the match is the correct offset required for aBridgeType
+ // to fit, and that the string begins with aBridgeType
+ if (
+ key.search(pattern) == aBridgeType.length &&
+ key.startsWith(aBridgeType)
+ ) {
+ let bridgeStr = bridgeBranch.getCharPref(key);
+ retval.push(bridgeStr);
+ }
+ }
+
+ // fisher-yates shuffle
+ // shuffle so that Tor Browser users don't all try the built-in bridges in the same order
+ for (let i = retval.length - 1; i > 0; --i) {
+ // number n such that 0.0 <= n < 1.0
+ const n = Math.random();
+ // integer j such that 0 <= j <= i
+ const j = Math.floor(n * (i + 1));
+
+ // swap values at indices i and j
+ const tmp = retval[i];
+ retval[i] = retval[j];
+ retval[j] = tmp;
+ }
+
+ return retval;
+ }
+
+ _readBridgeDBBridges() {
+ let bridgeBranch = Services.prefs.getBranch(
+ `${TorStrings.preferenceBranches.bridgeDBBridges}`
+ );
+ let bridgeBranchPrefs = bridgeBranch.getChildList("", {});
+ // the child prefs do not come in any particular order so sort the keys
+ // so the values can be compared to what we get out off torrc
+ bridgeBranchPrefs.sort();
+
+ // just assume all of the prefs under the parent point to valid bridge string
+ let retval = bridgeBranchPrefs.map(key =>
+ bridgeBranch.getCharPref(key).trim()
+ );
+
+ return retval;
+ }
+
+ _readTorrcBridges() {
+ let bridgeList = TorProtocolService.readStringArraySetting(
+ TorStrings.configKeys.bridgeList
+ );
+
+ let retval = [];
+ for (const line of bridgeList) {
+ let trimmedLine = line.trim();
+ if (trimmedLine) {
+ retval.push(trimmedLine);
+ }
+ }
+
+ return retval;
+ }
+
+ // analagous to initBridgeSettings()
+ readSettings() {
+ // restore to defaults
+ this._bridgeSource = TorBridgeSource.NONE;
+ this._selectedDefaultBridgeType = null;
+ this._bridgeStrings = [];
+
+ // So the way tor-launcher determines the origin of the configured bridges is a bit
+ // weird and depends on inferring our scenario based on some firefox prefs and the
+ // relationship between the saved list of bridges in about:config vs the list saved in torrc
+
+ // first off, if "extensions.torlauncher.default_bridge_type" is set to one of our
+ // builtin default types (obfs4, meek-azure, snowflake, etc) then we provide the
+ // bridges in "extensions.torlauncher.default_bridge.*" (filtered by our default_bridge_type)
+
+ // next, we compare the list of bridges saved in torrc to the bridges stored in the
+ // "extensions.torlauncher.bridgedb_bridge."" branch. If they match *exactly* then we assume
+ // the bridges were retrieved from BridgeDB and use those. If the torrc list is empty then we know
+ // we have no bridge settings
+
+ // finally, if none of the previous conditions are not met, it is assumed the bridges stored in
+ // torrc are user-provided
+
+ // what we should(?) do once we excise tor-launcher entirely is explicitly store an int/enum in
+ // about:config that tells us which scenario we are in so we don't have to guess
+
+ let defaultBridgeType = Services.prefs.getCharPref(
+ TorStrings.preferenceKeys.defaultBridgeType,
+ null
+ );
+
+ // check if source is BUILTIN
+ if (defaultBridgeType) {
+ this._bridgeStrings = this._readDefaultBridges(defaultBridgeType);
+ this._bridgeSource = TorBridgeSource.BUILTIN;
+ this._selectedDefaultBridgeType = defaultBridgeType;
+ return;
+ }
+
+ let torrcBridges = this._readTorrcBridges();
+
+ // no stored bridges means no bridge is in use
+ if (torrcBridges.length == 0) {
+ this._bridgeStrings = [];
+ this._bridgeSource = TorBridgeSource.NONE;
+ return;
+ }
+
+ let bridgedbBridges = this._readBridgeDBBridges();
+
+ // if these two lists are equal then we got our bridges from bridgedb
+ // ie: same element in identical order
+ let arraysEqual = (left, right) => {
+ if (left.length != right.length) {
+ return false;
+ }
+ const length = left.length;
+ for (let i = 0; i < length; ++i) {
+ if (left[i] != right[i]) {
+ return false;
+ }
+ }
+ return true;
+ };
+
+ // agreement between prefs and torrc means bridgedb bridges
+ if (arraysEqual(torrcBridges, bridgedbBridges)) {
+ this._bridgeStrings = torrcBridges;
+ this._bridgeSource = TorBridgeSource.BRIDGEDB;
+ return;
+ }
+
+ // otherwise they must be user provided
+ this._bridgeStrings = torrcBridges;
+ this._bridgeSource = TorBridgeSource.USERPROVIDED;
+ }
+
+ writeSettings() {
+ let settingsObject = new Map();
+
+ // init tor bridge settings to null
+ settingsObject.set(TorStrings.configKeys.useBridges, null);
+ settingsObject.set(TorStrings.configKeys.bridgeList, null);
+
+ // clear bridge related firefox prefs
+ Services.prefs.setCharPref(TorStrings.preferenceKeys.defaultBridgeType, "");
+ let bridgeBranch = Services.prefs.getBranch(
+ `${TorStrings.preferenceBranches.bridgeDBBridges}`
+ );
+ let bridgeBranchPrefs = bridgeBranch.getChildList("", {});
+ for (const pref of bridgeBranchPrefs) {
+ Services.prefs.clearUserPref(
+ `${TorStrings.preferenceBranches.bridgeDBBridges}${pref}`
+ );
+ }
+
+ switch (this._bridgeSource) {
+ case TorBridgeSource.BUILTIN:
+ // set builtin bridge type to use in prefs
+ Services.prefs.setCharPref(
+ TorStrings.preferenceKeys.defaultBridgeType,
+ this._selectedDefaultBridgeType
+ );
+ break;
+ case TorBridgeSource.BRIDGEDB:
+ // save bridges off to prefs
+ for (let i = 0; i < this.bridgeStringsArray.length; ++i) {
+ Services.prefs.setCharPref(
+ `${TorStrings.preferenceBranches.bridgeDBBridges}${i}`,
+ this.bridgeStringsArray[i]
+ );
+ }
+ break;
+ }
+
+ // write over our bridge list if bridges are enabled
+ if (this._bridgeSource != TorBridgeSource.NONE) {
+ settingsObject.set(TorStrings.configKeys.useBridges, true);
+ settingsObject.set(
+ TorStrings.configKeys.bridgeList,
+ this.bridgeStringsArray
+ );
+ }
+ TorProtocolService.writeSettings(settingsObject);
+ }
+}
+
+function makeTorBridgeSettingsNone() {
+ return new TorBridgeSettings();
+}
+
+function makeTorBridgeSettingsBuiltin(aBridgeType) {
+ let retval = new TorBridgeSettings();
+ retval._bridgeSource = TorBridgeSource.BUILTIN;
+ retval._selectedDefaultBridgeType = aBridgeType;
+ retval._bridgeStrings = retval._readDefaultBridges(aBridgeType);
+
+ return retval;
+}
+
+function makeTorBridgeSettingsBridgeDB(aBridges) {
+ let retval = new TorBridgeSettings();
+ retval._bridgeSource = TorBridgeSource.BRIDGEDB;
+ retval._selectedDefaultBridgeType = null;
+ retval._bridgeStrings = aBridges;
+
+ return retval;
+}
+
+function makeTorBridgeSettingsUserProvided(aBridges) {
+ let retval = new TorBridgeSettings();
+ retval._bridgeSource = TorBridgeSource.USERPROVIDED;
+ retval._selectedDefaultBridgeType = null;
+ retval._bridgeStrings = aBridges;
+
+ return retval;
+}
diff --git a/browser/components/torpreferences/content/torCategory.inc.xhtml b/browser/components/torpreferences/content/torCategory.inc.xhtml
new file mode 100644
index 000000000000..abe56200f571
--- /dev/null
+++ b/browser/components/torpreferences/content/torCategory.inc.xhtml
@@ -0,0 +1,9 @@
+<richlistitem id="category-tor"
+ class="category"
+ value="paneTor"
+ helpTopic="prefs-tor"
+ align="center"
+ hidden="true">
+ <image class="category-icon"/>
+ <label id="torPreferences-labelCategory" class="category-name" flex="1" value="Tor"/>
+</richlistitem>
diff --git a/browser/components/torpreferences/content/torFirewallSettings.jsm b/browser/components/torpreferences/content/torFirewallSettings.jsm
new file mode 100644
index 000000000000..e77f18ef2fae
--- /dev/null
+++ b/browser/components/torpreferences/content/torFirewallSettings.jsm
@@ -0,0 +1,72 @@
+"use strict";
+
+var EXPORTED_SYMBOLS = [
+ "TorFirewallSettings",
+ "makeTorFirewallSettingsNone",
+ "makeTorFirewallSettingsCustom",
+];
+
+const { TorProtocolService } = ChromeUtils.import(
+ "resource:///modules/TorProtocolService.jsm"
+);
+const { TorStrings } = ChromeUtils.import("resource:///modules/TorStrings.jsm");
+const { parseAddrPortList } = ChromeUtils.import(
+ "chrome://browser/content/torpreferences/parseFunctions.jsm"
+);
+
+class TorFirewallSettings {
+ constructor() {
+ this._allowedPorts = [];
+ }
+
+ get portsConfigurationString() {
+ let portStrings = this._allowedPorts.map(port => `*:${port}`);
+ return portStrings.join(",");
+ }
+
+ get commaSeparatedListString() {
+ return this._allowedPorts.join(",");
+ }
+
+ get hasPorts() {
+ return this._allowedPorts.length > 0;
+ }
+
+ readSettings() {
+ let addressPortList = TorProtocolService.readStringSetting(
+ TorStrings.configKeys.reachableAddresses
+ );
+
+ let allowedPorts = [];
+ if (addressPortList) {
+ allowedPorts = parseAddrPortList(addressPortList);
+ }
+ this._allowedPorts = allowedPorts;
+ }
+
+ writeSettings() {
+ let settingsObject = new Map();
+
+ // init to null so Tor daemon resets if no ports
+ settingsObject.set(TorStrings.configKeys.reachableAddresses, null);
+
+ if (this._allowedPorts.length > 0) {
+ settingsObject.set(
+ TorStrings.configKeys.reachableAddresses,
+ this.portsConfigurationString
+ );
+ }
+
+ TorProtocolService.writeSettings(settingsObject);
+ }
+}
+
+function makeTorFirewallSettingsNone() {
+ return new TorFirewallSettings();
+}
+
+function makeTorFirewallSettingsCustom(aPortsList) {
+ let retval = new TorFirewallSettings();
+ retval._allowedPorts = aPortsList;
+ return retval;
+}
diff --git a/browser/components/torpreferences/content/torLogDialog.jsm b/browser/components/torpreferences/content/torLogDialog.jsm
new file mode 100644
index 000000000000..ecc684d878c2
--- /dev/null
+++ b/browser/components/torpreferences/content/torLogDialog.jsm
@@ -0,0 +1,66 @@
+"use strict";
+
+var EXPORTED_SYMBOLS = ["TorLogDialog"];
+
+const { TorProtocolService } = ChromeUtils.import(
+ "resource:///modules/TorProtocolService.jsm"
+);
+const { TorStrings } = ChromeUtils.import("resource:///modules/TorStrings.jsm");
+
+class TorLogDialog {
+ constructor() {
+ this._dialog = null;
+ this._logTextarea = null;
+ this._copyLogButton = null;
+ }
+
+ static get selectors() {
+ return {
+ copyLogButton: "extra1",
+ logTextarea: "textarea#torPreferences-torDialog-textarea",
+ };
+ }
+
+ _populateXUL(aDialog) {
+ this._dialog = aDialog;
+ const dialogWin = this._dialog.parentElement;
+ dialogWin.setAttribute("title", TorStrings.settings.torLogDialogTitle);
+
+ this._logTextarea = this._dialog.querySelector(
+ TorLogDialog.selectors.logTextarea
+ );
+
+ this._copyLogButton = this._dialog.getButton(
+ TorLogDialog.selectors.copyLogButton
+ );
+ this._copyLogButton.setAttribute("label", TorStrings.settings.copyLog);
+ this._copyLogButton.addEventListener("command", () => {
+ this.copyTorLog();
+ });
+
+ this._logTextarea.value = TorProtocolService.getLog();
+ }
+
+ init(window, aDialog) {
+ // defer to later until firefox has populated the dialog with all our elements
+ window.setTimeout(() => {
+ this._populateXUL(aDialog);
+ }, 0);
+ }
+
+ copyTorLog() {
+ // Copy tor log messages to the system clipboard.
+ let clipboard = Cc["@mozilla.org/widget/clipboardhelper;1"].getService(
+ Ci.nsIClipboardHelper
+ );
+ clipboard.copyString(this._logTextarea.value);
+ }
+
+ openDialog(gSubDialog) {
+ gSubDialog.open(
+ "chrome://browser/content/torpreferences/torLogDialog.xhtml",
+ { features: "resizable=yes" },
+ this
+ );
+ }
+}
diff --git a/browser/components/torpreferences/content/torLogDialog.xhtml b/browser/components/torpreferences/content/torLogDialog.xhtml
new file mode 100644
index 000000000000..9c17f8132978
--- /dev/null
+++ b/browser/components/torpreferences/content/torLogDialog.xhtml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+<?xml-stylesheet href="chrome://browser/skin/preferences/preferences.css"?>
+<?xml-stylesheet href="chrome://browser/content/torpreferences/torPreferences.css"?>
+
+<window type="child"
+ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+ xmlns:html="http://www.w3.org/1999/xhtml">
+<dialog id="torPreferences-torLog-dialog"
+ buttons="accept,extra1">
+ <html:textarea
+ id="torPreferences-torDialog-textarea"
+ multiline="true"
+ readonly="true"/>
+ <script type="application/javascript"><![CDATA[
+ "use strict";
+
+ let torLogDialog = window.arguments[0];
+ let dialog = document.getElementById("torPreferences-torLog-dialog");
+ torLogDialog.init(window, dialog);
+ ]]></script>
+</dialog>
+</window>
\ No newline at end of file
diff --git a/browser/components/torpreferences/content/torPane.js b/browser/components/torpreferences/content/torPane.js
new file mode 100644
index 000000000000..49054b5dac6a
--- /dev/null
+++ b/browser/components/torpreferences/content/torPane.js
@@ -0,0 +1,857 @@
+"use strict";
+
+const { TorProtocolService } = ChromeUtils.import(
+ "resource:///modules/TorProtocolService.jsm"
+);
+
+const {
+ TorBridgeSource,
+ TorBridgeSettings,
+ makeTorBridgeSettingsNone,
+ makeTorBridgeSettingsBuiltin,
+ makeTorBridgeSettingsBridgeDB,
+ makeTorBridgeSettingsUserProvided,
+} = ChromeUtils.import(
+ "chrome://browser/content/torpreferences/torBridgeSettings.jsm"
+);
+
+const {
+ TorProxyType,
+ TorProxySettings,
+ makeTorProxySettingsNone,
+ makeTorProxySettingsSocks4,
+ makeTorProxySettingsSocks5,
+ makeTorProxySettingsHTTPS,
+} = ChromeUtils.import(
+ "chrome://browser/content/torpreferences/torProxySettings.jsm"
+);
+const {
+ TorFirewallSettings,
+ makeTorFirewallSettingsNone,
+ makeTorFirewallSettingsCustom,
+} = ChromeUtils.import(
+ "chrome://browser/content/torpreferences/torFirewallSettings.jsm"
+);
+
+const { TorLogDialog } = ChromeUtils.import(
+ "chrome://browser/content/torpreferences/torLogDialog.jsm"
+);
+
+const { RequestBridgeDialog } = ChromeUtils.import(
+ "chrome://browser/content/torpreferences/requestBridgeDialog.jsm"
+);
+
+ChromeUtils.defineModuleGetter(
+ this,
+ "TorStrings",
+ "resource:///modules/TorStrings.jsm"
+);
+
+const { parsePort, parseBridgeStrings, parsePortList } = ChromeUtils.import(
+ "chrome://browser/content/torpreferences/parseFunctions.jsm"
+);
+
+/*
+ Tor Pane
+
+ Code for populating the XUL in about:preferences#tor, handling input events, interfacing with tor-launcher
+*/
+const gTorPane = (function() {
+ /* CSS selectors for all of the Tor Network DOM elements we need to access */
+ const selectors = {
+ category: {
+ title: "label#torPreferences-labelCategory",
+ },
+ torPreferences: {
+ header: "h1#torPreferences-header",
+ description: "span#torPreferences-description",
+ learnMore: "label#torPreferences-learnMore",
+ },
+ bridges: {
+ header: "h2#torPreferences-bridges-header",
+ description: "span#torPreferences-bridges-description",
+ learnMore: "label#torPreferences-bridges-learnMore",
+ useBridgeCheckbox: "checkbox#torPreferences-bridges-toggle",
+ bridgeSelectionRadiogroup:
+ "radiogroup#torPreferences-bridges-bridgeSelection",
+ builtinBridgeOption: "radio#torPreferences-bridges-radioBuiltin",
+ builtinBridgeList: "menulist#torPreferences-bridges-builtinList",
+ requestBridgeOption: "radio#torPreferences-bridges-radioRequestBridge",
+ requestBridgeButton: "button#torPreferences-bridges-buttonRequestBridge",
+ requestBridgeTextarea:
+ "textarea#torPreferences-bridges-textareaRequestBridge",
+ provideBridgeOption: "radio#torPreferences-bridges-radioProvideBridge",
+ provideBridgeDescription:
+ "description#torPreferences-bridges-descriptionProvideBridge",
+ provideBridgeTextarea:
+ "textarea#torPreferences-bridges-textareaProvideBridge",
+ },
+ advanced: {
+ header: "h2#torPreferences-advanced-header",
+ description: "span#torPreferences-advanced-description",
+ learnMore: "label#torPreferences-advanced-learnMore",
+ useProxyCheckbox: "checkbox#torPreferences-advanced-toggleProxy",
+ proxyTypeLabel: "label#torPreferences-localProxy-type",
+ proxyTypeList: "menulist#torPreferences-localProxy-builtinList",
+ proxyAddressLabel: "label#torPreferences-localProxy-address",
+ proxyAddressTextbox: "input#torPreferences-localProxy-textboxAddress",
+ proxyPortLabel: "label#torPreferences-localProxy-port",
+ proxyPortTextbox: "input#torPreferences-localProxy-textboxPort",
+ proxyUsernameLabel: "label#torPreferences-localProxy-username",
+ proxyUsernameTextbox: "input#torPreferences-localProxy-textboxUsername",
+ proxyPasswordLabel: "label#torPreferences-localProxy-password",
+ proxyPasswordTextbox: "input#torPreferences-localProxy-textboxPassword",
+ useFirewallCheckbox: "checkbox#torPreferences-advanced-toggleFirewall",
+ firewallAllowedPortsLabel: "label#torPreferences-advanced-allowedPorts",
+ firewallAllowedPortsTextbox:
+ "input#torPreferences-advanced-textboxAllowedPorts",
+ torLogsLabel: "label#torPreferences-torLogs",
+ torLogsButton: "button#torPreferences-buttonTorLogs",
+ },
+ }; /* selectors */
+
+ let retval = {
+ // cached frequently accessed DOM elements
+ _useBridgeCheckbox: null,
+ _bridgeSelectionRadiogroup: null,
+ _builtinBridgeOption: null,
+ _builtinBridgeMenulist: null,
+ _requestBridgeOption: null,
+ _requestBridgeButton: null,
+ _requestBridgeTextarea: null,
+ _provideBridgeOption: null,
+ _provideBridgeTextarea: null,
+ _useProxyCheckbox: null,
+ _proxyTypeLabel: null,
+ _proxyTypeMenulist: null,
+ _proxyAddressLabel: null,
+ _proxyAddressTextbox: null,
+ _proxyPortLabel: null,
+ _proxyPortTextbox: null,
+ _proxyUsernameLabel: null,
+ _proxyUsernameTextbox: null,
+ _proxyPasswordLabel: null,
+ _proxyPasswordTextbox: null,
+ _useFirewallCheckbox: null,
+ _allowedPortsLabel: null,
+ _allowedPortsTextbox: null,
+
+ // tor network settings
+ _bridgeSettings: null,
+ _proxySettings: null,
+ _firewallSettings: null,
+
+ // disables the provided list of elements
+ _setElementsDisabled(elements, disabled) {
+ for (let currentElement of elements) {
+ currentElement.disabled = disabled;
+ }
+ },
+
+ // populate xul with strings and cache the relevant elements
+ _populateXUL() {
+ // saves tor settings to disk when navigate away from about:preferences
+ window.addEventListener("blur", val => {
+ TorProtocolService.flushSettings();
+ });
+
+ document
+ .querySelector(selectors.category.title)
+ .setAttribute("value", TorStrings.settings.categoryTitle);
+
+ let prefpane = document.getElementById("mainPrefPane");
+
+ // Heading
+ prefpane.querySelector(selectors.torPreferences.header).innerText =
+ TorStrings.settings.torPreferencesHeading;
+ prefpane.querySelector(selectors.torPreferences.description).textContent =
+ TorStrings.settings.torPreferencesDescription;
+ {
+ let learnMore = prefpane.querySelector(
+ selectors.torPreferences.learnMore
+ );
+ learnMore.setAttribute("value", TorStrings.settings.learnMore);
+ learnMore.setAttribute(
+ "href",
+ TorStrings.settings.learnMoreTorBrowserURL
+ );
+ }
+
+ // Bridge setup
+ prefpane.querySelector(selectors.bridges.header).innerText =
+ TorStrings.settings.bridgesHeading;
+ prefpane.querySelector(selectors.bridges.description).textContent =
+ TorStrings.settings.bridgesDescription;
+ {
+ let learnMore = prefpane.querySelector(selectors.bridges.learnMore);
+ learnMore.setAttribute("value", TorStrings.settings.learnMore);
+ learnMore.setAttribute("href", TorStrings.settings.learnMoreBridgesURL);
+ }
+
+ this._useBridgeCheckbox = prefpane.querySelector(
+ selectors.bridges.useBridgeCheckbox
+ );
+ this._useBridgeCheckbox.setAttribute(
+ "label",
+ TorStrings.settings.useBridge
+ );
+ this._useBridgeCheckbox.addEventListener("command", e => {
+ const checked = this._useBridgeCheckbox.checked;
+ gTorPane.onToggleBridge(checked).onUpdateBridgeSettings();
+ });
+ this._bridgeSelectionRadiogroup = prefpane.querySelector(
+ selectors.bridges.bridgeSelectionRadiogroup
+ );
+ this._bridgeSelectionRadiogroup.value = TorBridgeSource.BUILTIN;
+ this._bridgeSelectionRadiogroup.addEventListener("command", e => {
+ const value = this._bridgeSelectionRadiogroup.value;
+ gTorPane.onSelectBridgeOption(value).onUpdateBridgeSettings();
+ });
+
+ // Builtin bridges
+ this._builtinBridgeOption = prefpane.querySelector(
+ selectors.bridges.builtinBridgeOption
+ );
+ this._builtinBridgeOption.setAttribute(
+ "label",
+ TorStrings.settings.selectBridge
+ );
+ this._builtinBridgeOption.setAttribute("value", TorBridgeSource.BUILTIN);
+ this._builtinBridgeMenulist = prefpane.querySelector(
+ selectors.bridges.builtinBridgeList
+ );
+ this._builtinBridgeMenulist.addEventListener("command", e => {
+ gTorPane.onUpdateBridgeSettings();
+ });
+
+ // Request bridge
+ this._requestBridgeOption = prefpane.querySelector(
+ selectors.bridges.requestBridgeOption
+ );
+ this._requestBridgeOption.setAttribute(
+ "label",
+ TorStrings.settings.requestBridgeFromTorProject
+ );
+ this._requestBridgeOption.setAttribute("value", TorBridgeSource.BRIDGEDB);
+ this._requestBridgeButton = prefpane.querySelector(
+ selectors.bridges.requestBridgeButton
+ );
+ this._requestBridgeButton.setAttribute(
+ "label",
+ TorStrings.settings.requestNewBridge
+ );
+ this._requestBridgeButton.addEventListener("command", () =>
+ gTorPane.onRequestBridge()
+ );
+ this._requestBridgeTextarea = prefpane.querySelector(
+ selectors.bridges.requestBridgeTextarea
+ );
+
+ // Provide a bridge
+ this._provideBridgeOption = prefpane.querySelector(
+ selectors.bridges.provideBridgeOption
+ );
+ this._provideBridgeOption.setAttribute(
+ "label",
+ TorStrings.settings.provideBridge
+ );
+ this._provideBridgeOption.setAttribute(
+ "value",
+ TorBridgeSource.USERPROVIDED
+ );
+ prefpane.querySelector(
+ selectors.bridges.provideBridgeDescription
+ ).textContent = TorStrings.settings.provideBridgeDirections;
+ this._provideBridgeTextarea = prefpane.querySelector(
+ selectors.bridges.provideBridgeTextarea
+ );
+ this._provideBridgeTextarea.setAttribute(
+ "placeholder",
+ TorStrings.settings.provideBridgePlaceholder
+ );
+ this._provideBridgeTextarea.addEventListener("blur", () => {
+ gTorPane.onUpdateBridgeSettings();
+ });
+
+ // Advanced setup
+ prefpane.querySelector(selectors.advanced.header).innerText =
+ TorStrings.settings.advancedHeading;
+ prefpane.querySelector(selectors.advanced.description).textContent =
+ TorStrings.settings.advancedDescription;
+ {
+ let learnMore = prefpane.querySelector(selectors.advanced.learnMore);
+ learnMore.setAttribute("value", TorStrings.settings.learnMore);
+ learnMore.setAttribute(
+ "href",
+ TorStrings.settings.learnMoreNetworkSettingsURL
+ );
+ }
+
+ // Local Proxy
+ this._useProxyCheckbox = prefpane.querySelector(
+ selectors.advanced.useProxyCheckbox
+ );
+ this._useProxyCheckbox.setAttribute(
+ "label",
+ TorStrings.settings.useLocalProxy
+ );
+ this._useProxyCheckbox.addEventListener("command", e => {
+ const checked = this._useProxyCheckbox.checked;
+ gTorPane.onToggleProxy(checked).onUpdateProxySettings();
+ });
+ this._proxyTypeLabel = prefpane.querySelector(
+ selectors.advanced.proxyTypeLabel
+ );
+ this._proxyTypeLabel.setAttribute("value", TorStrings.settings.proxyType);
+
+ let mockProxies = [
+ {
+ value: TorProxyType.SOCKS4,
+ label: TorStrings.settings.proxyTypeSOCKS4,
+ },
+ {
+ value: TorProxyType.SOCKS5,
+ label: TorStrings.settings.proxyTypeSOCKS5,
+ },
+ { value: TorProxyType.HTTPS, label: TorStrings.settings.proxyTypeHTTP },
+ ];
+ this._proxyTypeMenulist = prefpane.querySelector(
+ selectors.advanced.proxyTypeList
+ );
+ this._proxyTypeMenulist.addEventListener("command", e => {
+ const value = this._proxyTypeMenulist.value;
+ gTorPane.onSelectProxyType(value).onUpdateProxySettings();
+ });
+ for (let currentProxy of mockProxies) {
+ let menuEntry = document.createXULElement("menuitem");
+ menuEntry.setAttribute("value", currentProxy.value);
+ menuEntry.setAttribute("label", currentProxy.label);
+ this._proxyTypeMenulist
+ .querySelector("menupopup")
+ .appendChild(menuEntry);
+ }
+
+ this._proxyAddressLabel = prefpane.querySelector(
+ selectors.advanced.proxyAddressLabel
+ );
+ this._proxyAddressLabel.setAttribute(
+ "value",
+ TorStrings.settings.proxyAddress
+ );
+ this._proxyAddressTextbox = prefpane.querySelector(
+ selectors.advanced.proxyAddressTextbox
+ );
+ this._proxyAddressTextbox.setAttribute(
+ "placeholder",
+ TorStrings.settings.proxyAddressPlaceholder
+ );
+ this._proxyAddressTextbox.addEventListener("blur", () => {
+ gTorPane.onUpdateProxySettings();
+ });
+ this._proxyPortLabel = prefpane.querySelector(
+ selectors.advanced.proxyPortLabel
+ );
+ this._proxyPortLabel.setAttribute("value", TorStrings.settings.proxyPort);
+ this._proxyPortTextbox = prefpane.querySelector(
+ selectors.advanced.proxyPortTextbox
+ );
+ this._proxyPortTextbox.addEventListener("blur", () => {
+ gTorPane.onUpdateProxySettings();
+ });
+ this._proxyUsernameLabel = prefpane.querySelector(
+ selectors.advanced.proxyUsernameLabel
+ );
+ this._proxyUsernameLabel.setAttribute(
+ "value",
+ TorStrings.settings.proxyUsername
+ );
+ this._proxyUsernameTextbox = prefpane.querySelector(
+ selectors.advanced.proxyUsernameTextbox
+ );
+ this._proxyUsernameTextbox.setAttribute(
+ "placeholder",
+ TorStrings.settings.proxyUsernamePasswordPlaceholder
+ );
+ this._proxyUsernameTextbox.addEventListener("blur", () => {
+ gTorPane.onUpdateProxySettings();
+ });
+ this._proxyPasswordLabel = prefpane.querySelector(
+ selectors.advanced.proxyPasswordLabel
+ );
+ this._proxyPasswordLabel.setAttribute(
+ "value",
+ TorStrings.settings.proxyPassword
+ );
+ this._proxyPasswordTextbox = prefpane.querySelector(
+ selectors.advanced.proxyPasswordTextbox
+ );
+ this._proxyPasswordTextbox.setAttribute(
+ "placeholder",
+ TorStrings.settings.proxyUsernamePasswordPlaceholder
+ );
+ this._proxyPasswordTextbox.addEventListener("blur", () => {
+ gTorPane.onUpdateProxySettings();
+ });
+
+ // Local firewall
+ this._useFirewallCheckbox = prefpane.querySelector(
+ selectors.advanced.useFirewallCheckbox
+ );
+ this._useFirewallCheckbox.setAttribute(
+ "label",
+ TorStrings.settings.useFirewall
+ );
+ this._useFirewallCheckbox.addEventListener("command", e => {
+ const checked = this._useFirewallCheckbox.checked;
+ gTorPane.onToggleFirewall(checked).onUpdateFirewallSettings();
+ });
+ this._allowedPortsLabel = prefpane.querySelector(
+ selectors.advanced.firewallAllowedPortsLabel
+ );
+ this._allowedPortsLabel.setAttribute(
+ "value",
+ TorStrings.settings.allowedPorts
+ );
+ this._allowedPortsTextbox = prefpane.querySelector(
+ selectors.advanced.firewallAllowedPortsTextbox
+ );
+ this._allowedPortsTextbox.setAttribute(
+ "placeholder",
+ TorStrings.settings.allowedPortsPlaceholder
+ );
+ this._allowedPortsTextbox.addEventListener("blur", () => {
+ gTorPane.onUpdateFirewallSettings();
+ });
+
+ // Tor logs
+ prefpane
+ .querySelector(selectors.advanced.torLogsLabel)
+ .setAttribute("value", TorStrings.settings.showTorDaemonLogs);
+ let torLogsButton = prefpane.querySelector(
+ selectors.advanced.torLogsButton
+ );
+ torLogsButton.setAttribute("label", TorStrings.settings.showLogs);
+ torLogsButton.addEventListener("command", () => {
+ gTorPane.onViewTorLogs();
+ });
+
+ // Disable all relevant elements by default
+ this._setElementsDisabled(
+ [
+ this._builtinBridgeOption,
+ this._builtinBridgeMenulist,
+ this._requestBridgeOption,
+ this._requestBridgeButton,
+ this._requestBridgeTextarea,
+ this._provideBridgeOption,
+ this._provideBridgeTextarea,
+ this._proxyTypeLabel,
+ this._proxyTypeMenulist,
+ this._proxyAddressLabel,
+ this._proxyAddressTextbox,
+ this._proxyPortLabel,
+ this._proxyPortTextbox,
+ this._proxyUsernameLabel,
+ this._proxyUsernameTextbox,
+ this._proxyPasswordLabel,
+ this._proxyPasswordTextbox,
+ this._allowedPortsLabel,
+ this._allowedPortsTextbox,
+ ],
+ true
+ );
+
+ // load bridge settings
+ let torBridgeSettings = new TorBridgeSettings();
+ torBridgeSettings.readSettings();
+
+ // populate the bridge list
+ for (let currentBridge of TorBridgeSettings.defaultBridgeTypes) {
+ let menuEntry = document.createXULElement("menuitem");
+ menuEntry.setAttribute("value", currentBridge);
+ menuEntry.setAttribute("label", currentBridge);
+ this._builtinBridgeMenulist
+ .querySelector("menupopup")
+ .appendChild(menuEntry);
+ }
+
+ this.onSelectBridgeOption(torBridgeSettings.bridgeSource);
+ this.onToggleBridge(
+ torBridgeSettings.bridgeSource != TorBridgeSource.NONE
+ );
+ switch (torBridgeSettings.bridgeSource) {
+ case TorBridgeSource.NONE:
+ break;
+ case TorBridgeSource.BUILTIN:
+ this._builtinBridgeMenulist.value =
+ torBridgeSettings.selectedDefaultBridgeType;
+ break;
+ case TorBridgeSource.BRIDGEDB:
+ this._requestBridgeTextarea.value = torBridgeSettings.bridgeStrings;
+ break;
+ case TorBridgeSource.USERPROVIDED:
+ this._provideBridgeTextarea.value = torBridgeSettings.bridgeStrings;
+ break;
+ }
+
+ this._bridgeSettings = torBridgeSettings;
+
+ // load proxy settings
+ let torProxySettings = new TorProxySettings();
+ torProxySettings.readSettings();
+
+ if (torProxySettings.type != TorProxyType.NONE) {
+ this.onToggleProxy(true);
+ this.onSelectProxyType(torProxySettings.type);
+ this._proxyAddressTextbox.value = torProxySettings.address;
+ this._proxyPortTextbox.value = torProxySettings.port;
+ this._proxyUsernameTextbox.value = torProxySettings.username;
+ this._proxyPasswordTextbox.value = torProxySettings.password;
+ }
+
+ this._proxySettings = torProxySettings;
+
+ // load firewall settings
+ let torFirewallSettings = new TorFirewallSettings();
+ torFirewallSettings.readSettings();
+
+ if (torFirewallSettings.hasPorts) {
+ this.onToggleFirewall(true);
+ this._allowedPortsTextbox.value =
+ torFirewallSettings.commaSeparatedListString;
+ }
+
+ this._firewallSettings = torFirewallSettings;
+ },
+
+ init() {
+ this._populateXUL();
+ },
+
+ // whether the page should be present in about:preferences
+ get enabled() {
+ return TorProtocolService.ownsTorDaemon;
+ },
+
+ //
+ // Callbacks
+ //
+
+ // callback when using bridges toggled
+ onToggleBridge(enabled) {
+ this._useBridgeCheckbox.checked = enabled;
+ let disabled = !enabled;
+
+ // first disable all the bridge related elements
+ this._setElementsDisabled(
+ [
+ this._builtinBridgeOption,
+ this._builtinBridgeMenulist,
+ this._requestBridgeOption,
+ this._requestBridgeButton,
+ this._requestBridgeTextarea,
+ this._provideBridgeOption,
+ this._provideBridgeTextarea,
+ ],
+ disabled
+ );
+
+ // and selectively re-enable based on the radiogroup's current value
+ if (enabled) {
+ this.onSelectBridgeOption(this._bridgeSelectionRadiogroup.value);
+ } else {
+ this.onSelectBridgeOption(TorBridgeSource.NONE);
+ }
+ return this;
+ },
+
+ // callback when a bridge option is selected
+ onSelectBridgeOption(source) {
+ // disable all of the bridge elements under radio buttons
+ this._setElementsDisabled(
+ [
+ this._builtinBridgeMenulist,
+ this._requestBridgeButton,
+ this._requestBridgeTextarea,
+ this._provideBridgeTextarea,
+ ],
+ true
+ );
+
+ if (source != TorBridgeSource.NONE) {
+ this._bridgeSelectionRadiogroup.value = source;
+ }
+
+ switch (source) {
+ case TorBridgeSource.BUILTIN: {
+ this._setElementsDisabled([this._builtinBridgeMenulist], false);
+ break;
+ }
+ case TorBridgeSource.BRIDGEDB: {
+ this._setElementsDisabled(
+ [this._requestBridgeButton, this._requestBridgeTextarea],
+ false
+ );
+ break;
+ }
+ case TorBridgeSource.USERPROVIDED: {
+ this._setElementsDisabled([this._provideBridgeTextarea], false);
+ break;
+ }
+ }
+ return this;
+ },
+
+ // called when the request bridge button is activated
+ onRequestBridge() {
+ let requestBridgeDialog = new RequestBridgeDialog();
+ requestBridgeDialog.openDialog(
+ gSubDialog,
+ this._proxySettings.proxyURI,
+ aBridges => {
+ if (aBridges.length > 0) {
+ let bridgeSettings = makeTorBridgeSettingsBridgeDB(aBridges);
+ bridgeSettings.writeSettings();
+ this._bridgeSettings = bridgeSettings;
+
+ this._requestBridgeTextarea.value = bridgeSettings.bridgeStrings;
+ }
+ }
+ );
+ return this;
+ },
+
+ // pushes bridge settings from UI to tor
+ onUpdateBridgeSettings() {
+ let bridgeSettings = null;
+
+ let source = this._useBridgeCheckbox.checked
+ ? this._bridgeSelectionRadiogroup.value
+ : TorBridgeSource.NONE;
+ switch (source) {
+ case TorBridgeSource.NONE: {
+ bridgeSettings = makeTorBridgeSettingsNone();
+ break;
+ }
+ case TorBridgeSource.BUILTIN: {
+ // if there is a built-in bridge already selected, use that
+ let bridgeType = this._builtinBridgeMenulist.value;
+ if (bridgeType) {
+ bridgeSettings = makeTorBridgeSettingsBuiltin(bridgeType);
+ } else {
+ bridgeSettings = makeTorBridgeSettingsNone();
+ }
+ break;
+ }
+ case TorBridgeSource.BRIDGEDB: {
+ // if there are bridgedb bridges saved in the text area, use them
+ let bridgeStrings = this._requestBridgeTextarea.value;
+ if (bridgeStrings) {
+ let bridgeStringList = parseBridgeStrings(bridgeStrings);
+ bridgeSettings = makeTorBridgeSettingsBridgeDB(bridgeStringList);
+ } else {
+ bridgeSettings = makeTorBridgeSettingsNone();
+ }
+ break;
+ }
+ case TorBridgeSource.USERPROVIDED: {
+ // if bridges already exist in the text area, use them
+ let bridgeStrings = this._provideBridgeTextarea.value;
+ if (bridgeStrings) {
+ let bridgeStringList = parseBridgeStrings(bridgeStrings);
+ bridgeSettings = makeTorBridgeSettingsUserProvided(
+ bridgeStringList
+ );
+ } else {
+ bridgeSettings = makeTorBridgeSettingsNone();
+ }
+ break;
+ }
+ }
+ bridgeSettings.writeSettings();
+ this._bridgeSettings = bridgeSettings;
+ return this;
+ },
+
+ // callback when proxy is toggled
+ onToggleProxy(enabled) {
+ this._useProxyCheckbox.checked = enabled;
+ let disabled = !enabled;
+
+ this._setElementsDisabled(
+ [
+ this._proxyTypeLabel,
+ this._proxyTypeMenulist,
+ this._proxyAddressLabel,
+ this._proxyAddressTextbox,
+ this._proxyPortLabel,
+ this._proxyPortTextbox,
+ this._proxyUsernameLabel,
+ this._proxyUsernameTextbox,
+ this._proxyPasswordLabel,
+ this._proxyPasswordTextbox,
+ ],
+ disabled
+ );
+ this.onSelectProxyType(this._proxyTypeMenulist.value);
+ return this;
+ },
+
+ // callback when proxy type is changed
+ onSelectProxyType(value) {
+ if (value == "") {
+ value = TorProxyType.NONE;
+ }
+ this._proxyTypeMenulist.value = value;
+ switch (value) {
+ case TorProxyType.NONE: {
+ this._setElementsDisabled(
+ [
+ this._proxyAddressLabel,
+ this._proxyAddressTextbox,
+ this._proxyPortLabel,
+ this._proxyPortTextbox,
+ this._proxyUsernameLabel,
+ this._proxyUsernameTextbox,
+ this._proxyPasswordLabel,
+ this._proxyPasswordTextbox,
+ ],
+ true
+ ); // DISABLE
+
+ this._proxyAddressTextbox.value = "";
+ this._proxyPortTextbox.value = "";
+ this._proxyUsernameTextbox.value = "";
+ this._proxyPasswordTextbox.value = "";
+ break;
+ }
+ case TorProxyType.SOCKS4: {
+ this._setElementsDisabled(
+ [
+ this._proxyAddressLabel,
+ this._proxyAddressTextbox,
+ this._proxyPortLabel,
+ this._proxyPortTextbox,
+ ],
+ false
+ ); // ENABLE
+ this._setElementsDisabled(
+ [
+ this._proxyUsernameLabel,
+ this._proxyUsernameTextbox,
+ this._proxyPasswordLabel,
+ this._proxyPasswordTextbox,
+ ],
+ true
+ ); // DISABLE
+
+ this._proxyUsernameTextbox.value = "";
+ this._proxyPasswordTextbox.value = "";
+ break;
+ }
+ case TorProxyType.SOCKS5:
+ case TorProxyType.HTTPS: {
+ this._setElementsDisabled(
+ [
+ this._proxyAddressLabel,
+ this._proxyAddressTextbox,
+ this._proxyPortLabel,
+ this._proxyPortTextbox,
+ this._proxyUsernameLabel,
+ this._proxyUsernameTextbox,
+ this._proxyPasswordLabel,
+ this._proxyPasswordTextbox,
+ ],
+ false
+ ); // ENABLE
+ break;
+ }
+ }
+ return this;
+ },
+
+ // pushes proxy settings from UI to tor
+ onUpdateProxySettings() {
+ const proxyType = this._useProxyCheckbox.checked
+ ? this._proxyTypeMenulist.value
+ : TorProxyType.NONE;
+ const addressString = this._proxyAddressTextbox.value;
+ const portString = this._proxyPortTextbox.value;
+ const usernameString = this._proxyUsernameTextbox.value;
+ const passwordString = this._proxyPasswordTextbox.value;
+
+ let proxySettings = null;
+
+ switch (proxyType) {
+ case TorProxyType.NONE:
+ proxySettings = makeTorProxySettingsNone();
+ break;
+ case TorProxyType.SOCKS4:
+ proxySettings = makeTorProxySettingsSocks4(
+ addressString,
+ parsePort(portString)
+ );
+ break;
+ case TorProxyType.SOCKS5:
+ proxySettings = makeTorProxySettingsSocks5(
+ addressString,
+ parsePort(portString),
+ usernameString,
+ passwordString
+ );
+ break;
+ case TorProxyType.HTTPS:
+ proxySettings = makeTorProxySettingsHTTPS(
+ addressString,
+ parsePort(portString),
+ usernameString,
+ passwordString
+ );
+ break;
+ }
+
+ proxySettings.writeSettings();
+ this._proxySettings = proxySettings;
+ return this;
+ },
+
+ // callback when firewall proxy is toggled
+ onToggleFirewall(enabled) {
+ this._useFirewallCheckbox.checked = enabled;
+ let disabled = !enabled;
+
+ this._setElementsDisabled(
+ [this._allowedPortsLabel, this._allowedPortsTextbox],
+ disabled
+ );
+
+ return this;
+ },
+
+ // pushes firewall settings from UI to tor
+ onUpdateFirewallSettings() {
+ let portListString = this._useFirewallCheckbox.checked
+ ? this._allowedPortsTextbox.value
+ : "";
+ let firewallSettings = null;
+
+ if (portListString) {
+ firewallSettings = makeTorFirewallSettingsCustom(
+ parsePortList(portListString)
+ );
+ } else {
+ firewallSettings = makeTorFirewallSettingsNone();
+ }
+
+ firewallSettings.writeSettings();
+ this._firewallSettings = firewallSettings;
+ return this;
+ },
+
+ onViewTorLogs() {
+ let torLogDialog = new TorLogDialog();
+ torLogDialog.openDialog(gSubDialog);
+ },
+ };
+ return retval;
+})(); /* gTorPane */
diff --git a/browser/components/torpreferences/content/torPane.xhtml b/browser/components/torpreferences/content/torPane.xhtml
new file mode 100644
index 000000000000..3c966b2b3726
--- /dev/null
+++ b/browser/components/torpreferences/content/torPane.xhtml
@@ -0,0 +1,123 @@
+<!-- Tor panel -->
+
+<script type="application/javascript"
+ src="chrome://browser/content/torpreferences/torPane.js"/>
+<html:template id="template-paneTor">
+<hbox id="torPreferencesCategory"
+ class="subcategory"
+ data-category="paneTor"
+ hidden="true">
+ <html:h1 id="torPreferences-header"/>
+</hbox>
+
+<groupbox data-category="paneTor"
+ hidden="true">
+ <description flex="1">
+ <html:span id="torPreferences-description" class="tail-with-learn-more"/>
+ <label id="torPreferences-learnMore" class="learnMore text-link" is="text-link"/>
+ </description>
+</groupbox>
+
+<!-- Bridges -->
+<groupbox id="torPreferences-bridges-group"
+ data-category="paneTor"
+ hidden="true">
+ <html:h2 id="torPreferences-bridges-header"/>
+ <description flex="1">
+ <html:span id="torPreferences-bridges-description" class="tail-with-learn-more"/>
+ <label id="torPreferences-bridges-learnMore" class="learnMore text-link" is="text-link"/>
+ </description>
+ <checkbox id="torPreferences-bridges-toggle"/>
+ <radiogroup id="torPreferences-bridges-bridgeSelection">
+ <hbox class="indent">
+ <radio id="torPreferences-bridges-radioBuiltin"/>
+ <spacer flex="1"/>
+ <menulist id="torPreferences-bridges-builtinList" class="torMarginFix">
+ <menupopup/>
+ </menulist>
+ </hbox>
+ <vbox class="indent">
+ <hbox>
+ <radio id="torPreferences-bridges-radioRequestBridge"/>
+ <space flex="1"/>
+ <button id="torPreferences-bridges-buttonRequestBridge" class="torMarginFix"/>
+ </hbox>
+ <html:textarea
+ id="torPreferences-bridges-textareaRequestBridge"
+ class="indent torMarginFix"
+ multiline="true"
+ rows="3"
+ readonly="true"/>
+ </vbox>
+ <hbox class="indent" flex="1">
+ <vbox flex="1">
+ <radio id="torPreferences-bridges-radioProvideBridge"/>
+ <description id="torPreferences-bridges-descriptionProvideBridge" class="indent"/>
+ <html:textarea
+ id="torPreferences-bridges-textareaProvideBridge"
+ class="indent torMarginFix"
+ multiline="true"
+ rows="3"/>
+ </vbox>
+ </hbox>
+ </radiogroup>
+</groupbox>
+
+<!-- Advanced -->
+<groupbox id="torPreferences-advanced-group"
+ data-category="paneTor"
+ hidden="true">
+ <html:h2 id="torPreferences-advanced-header"/>
+ <description flex="1">
+ <html:span id="torPreferences-advanced-description" class="tail-with-learn-more"/>
+ <label id="torPreferences-advanced-learnMore" class="learnMore text-link" is="text-link" style="display:none"/>
+ </description>
+ <box id="torPreferences-advanced-grid">
+ <!-- Local Proxy -->
+ <hbox class="torPreferences-advanced-checkbox-container">
+ <checkbox id="torPreferences-advanced-toggleProxy"/>
+ </hbox>
+ <hbox class="indent" align="center">
+ <label id="torPreferences-localProxy-type"/>
+ </hbox>
+ <hbox align="center">
+ <spacer flex="1"/>
+ <menulist id="torPreferences-localProxy-builtinList" class="torMarginFix">
+ <menupopup/>
+ </menulist>
+ </hbox>
+ <hbox class="indent" align="center">
+ <label id="torPreferences-localProxy-address"/>
+ </hbox>
+ <hbox align="center">
+ <html:input id="torPreferences-localProxy-textboxAddress" type="text" class="torMarginFix"/>
+ <label id="torPreferences-localProxy-port"/>
+ <!-- proxy-port-input class style pulled from preferences.css and used in the vanilla proxy setup menu -->
+ <html:input id="torPreferences-localProxy-textboxPort" class="proxy-port-input torMarginFix" hidespinbuttons="true" type="number" min="0" max="65535" maxlength="5"/>
+ </hbox>
+ <hbox class="indent" align="center">
+ <label id="torPreferences-localProxy-username"/>
+ </hbox>
+ <hbox align="center">
+ <html:input id="torPreferences-localProxy-textboxUsername" type="text" class="torMarginFix"/>
+ <label id="torPreferences-localProxy-password"/>
+ <html:input id="torPreferences-localProxy-textboxPassword" class="torMarginFix" type="password"/>
+ </hbox>
+ <!-- Firewall -->
+ <hbox class="torPreferences-advanced-checkbox-container">
+ <checkbox id="torPreferences-advanced-toggleFirewall"/>
+ </hbox>
+ <hbox class="indent" align="center">
+ <label id="torPreferences-advanced-allowedPorts"/>
+ </hbox>
+ <hbox align="center">
+ <html:input id="torPreferences-advanced-textboxAllowedPorts" type="text" class="torMarginFix" value="80,443"/>
+ </hbox>
+ </box>
+ <hbox id="torPreferences-torDaemon-hbox" align="center">
+ <label id="torPreferences-torLogs"/>
+ <spacer flex="1"/>
+ <button id="torPreferences-buttonTorLogs" class="torMarginFix"/>
+ </hbox>
+</groupbox>
+</html:template>
\ No newline at end of file
diff --git a/browser/components/torpreferences/content/torPreferences.css b/browser/components/torpreferences/content/torPreferences.css
new file mode 100644
index 000000000000..4dac2c457823
--- /dev/null
+++ b/browser/components/torpreferences/content/torPreferences.css
@@ -0,0 +1,77 @@
+#category-tor > .category-icon {
+ list-style-image: url("chrome://browser/content/torpreferences/torPreferencesIcon.svg");
+}
+
+#torPreferences-advanced-grid {
+ display: grid;
+ grid-template-columns: auto 1fr;
+}
+
+.torPreferences-advanced-checkbox-container {
+ grid-column: 1 / 3;
+}
+
+#torPreferences-localProxy-textboxAddress,
+#torPreferences-localProxy-textboxUsername,
+#torPreferences-localProxy-textboxPassword,
+#torPreferences-advanced-textboxAllowedPorts {
+ -moz-box-flex: 1;
+}
+
+hbox#torPreferences-torDaemon-hbox {
+ margin-top: 20px;
+}
+
+description#torPreferences-requestBridge-description {
+ /*margin-bottom: 1em;*/
+ min-height: 2em;
+}
+
+image#torPreferences-requestBridge-captchaImage {
+ margin: 1em;
+ min-height: 125px;
+}
+
+button#torPreferences-requestBridge-refreshCaptchaButton {
+ min-width: initial;
+}
+
+dialog#torPreferences-requestBridge-dialog > hbox {
+ margin-bottom: 1em;
+}
+
+/*
+ Various elements that really should be lining up don't because they have inconsistent margins
+*/
+.torMarginFix {
+ margin-left : 4px;
+ margin-right : 4px;
+}
+
+/*
+ This hbox is hidden by css here by default so that the
+ xul dialog allocates enough screen space for the error message
+ element, otherwise it gets cut off since dialog's overflow is hidden
+*/
+hbox#torPreferences-requestBridge-incorrectCaptchaHbox {
+ visibility: hidden;
+}
+
+image#torPreferences-requestBridge-errorIcon {
+ list-style-image: url("chrome://browser/skin/warning.svg");
+}
+
+groupbox#torPreferences-bridges-group textarea {
+ white-space: pre;
+ overflow: auto;
+}
+
+textarea#torPreferences-torDialog-textarea {
+ -moz-box-flex: 1;
+ font-family: monospace;
+ font-size: 0.8em;
+ white-space: pre;
+ overflow: auto;
+ /* 10 lines */
+ min-height: 20em;
+}
\ No newline at end of file
diff --git a/browser/components/torpreferences/content/torPreferencesIcon.svg b/browser/components/torpreferences/content/torPreferencesIcon.svg
new file mode 100644
index 000000000000..d7895f1107c5
--- /dev/null
+++ b/browser/components/torpreferences/content/torPreferencesIcon.svg
@@ -0,0 +1,5 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
+ <g fill="context-fill" fill-opacity="context-fill-opacity" fill-rule="nonzero">
+ <path d="M12.0246161,21.8174863 L12.0246161,20.3628098 C16.6324777,20.3495038 20.3634751,16.6108555 20.3634751,11.9996673 C20.3634751,7.38881189 16.6324777,3.65016355 12.0246161,3.63685757 L12.0246161,2.18218107 C17.4358264,2.1958197 21.8178189,6.58546322 21.8178189,11.9996673 C21.8178189,17.4142042 17.4358264,21.8041803 12.0246161,21.8174863 L12.0246161,21.8174863 Z M12.0246161,16.7259522 C14.623607,16.7123136 16.7272828,14.6023175 16.7272828,11.9996673 C16.7272828,9.39734991 14.623607,7.28735377 12.0246161,7.27371516 L12.0246161,5.81937131 C15.4272884,5.8326773 18.1819593,8.59400123 18.1819593,11.9996673 C18.1819593,15.4056661 15.4272884,18.1669901 12.0246161,18.1802961 L12.0246161,16.7259522 Z M12.0246161,9.45556355 C13.4187503,9.46886953 14.5454344,10.6022066 14.5454344,11.9996673 C14.5454344,13.3974608 13.4187503,14.5307978 12.0246161,14.5441038 L12.0246161,9.45556355 Z M0,11.9996673 C0,18.6273771 5.37229031,24 12,24 C18.6273771,24 24,18.6273771 24,11.9996673 C24,5.37229031
18.6273771,0 12,0 C5.37229031,0 0,5.37229031 0,11.9996673 Z"/>
+ </g>
+</svg>
\ No newline at end of file
diff --git a/browser/components/torpreferences/content/torProxySettings.jsm b/browser/components/torpreferences/content/torProxySettings.jsm
new file mode 100644
index 000000000000..98bb5e8d5cbf
--- /dev/null
+++ b/browser/components/torpreferences/content/torProxySettings.jsm
@@ -0,0 +1,245 @@
+"use strict";
+
+var EXPORTED_SYMBOLS = [
+ "TorProxyType",
+ "TorProxySettings",
+ "makeTorProxySettingsNone",
+ "makeTorProxySettingsSocks4",
+ "makeTorProxySettingsSocks5",
+ "makeTorProxySettingsHTTPS",
+];
+
+const { TorProtocolService } = ChromeUtils.import(
+ "resource:///modules/TorProtocolService.jsm"
+);
+const { TorStrings } = ChromeUtils.import("resource:///modules/TorStrings.jsm");
+const { parseAddrPort, parseUsernamePassword } = ChromeUtils.import(
+ "chrome://browser/content/torpreferences/parseFunctions.jsm"
+);
+
+const TorProxyType = {
+ NONE: "NONE",
+ SOCKS4: "SOCKS4",
+ SOCKS5: "SOCKS5",
+ HTTPS: "HTTPS",
+};
+
+class TorProxySettings {
+ constructor() {
+ this._proxyType = TorProxyType.NONE;
+ this._proxyAddress = undefined;
+ this._proxyPort = undefined;
+ this._proxyUsername = undefined;
+ this._proxyPassword = undefined;
+ }
+
+ get type() {
+ return this._proxyType;
+ }
+ get address() {
+ return this._proxyAddress;
+ }
+ get port() {
+ return this._proxyPort;
+ }
+ get username() {
+ return this._proxyUsername;
+ }
+ get password() {
+ return this._proxyPassword;
+ }
+ get proxyURI() {
+ switch (this._proxyType) {
+ case TorProxyType.SOCKS4:
+ return `socks4a://${this._proxyAddress}:${this._proxyPort}`;
+ case TorProxyType.SOCKS5:
+ if (this._proxyUsername) {
+ return `socks5://${this._proxyUsername}:${this._proxyPassword}@${
+ this._proxyAddress
+ }:${this._proxyPort}`;
+ }
+ return `socks5://${this._proxyAddress}:${this._proxyPort}`;
+ case TorProxyType.HTTPS:
+ if (this._proxyUsername) {
+ return `http://${this._proxyUsername}:${this._proxyPassword}@${
+ this._proxyAddress
+ }:${this._proxyPort}`;
+ }
+ return `http://${this._proxyAddress}:${this._proxyPort}`;
+ }
+ return undefined;
+ }
+
+ // attempts to read proxy settings from Tor daemon
+ readSettings() {
+ // SOCKS4
+ {
+ let addressPort = TorProtocolService.readStringSetting(
+ TorStrings.configKeys.socks4Proxy
+ );
+ if (addressPort) {
+ // address+port
+ let [proxyAddress, proxyPort] = parseAddrPort(addressPort);
+
+ this._proxyType = TorProxyType.SOCKS4;
+ this._proxyAddress = proxyAddress;
+ this._proxyPort = proxyPort;
+ this._proxyUsername = "";
+ this._proxyPassword = "";
+
+ return;
+ }
+ }
+
+ // SOCKS5
+ {
+ let addressPort = TorProtocolService.readStringSetting(
+ TorStrings.configKeys.socks5Proxy
+ );
+
+ if (addressPort) {
+ // address+port
+ let [proxyAddress, proxyPort] = parseAddrPort(addressPort);
+ // username
+ let proxyUsername = TorProtocolService.readStringSetting(
+ TorStrings.configKeys.socks5ProxyUsername
+ );
+ // password
+ let proxyPassword = TorProtocolService.readStringSetting(
+ TorStrings.configKeys.socks5ProxyPassword
+ );
+
+ this._proxyType = TorProxyType.SOCKS5;
+ this._proxyAddress = proxyAddress;
+ this._proxyPort = proxyPort;
+ this._proxyUsername = proxyUsername;
+ this._proxyPassword = proxyPassword;
+
+ return;
+ }
+ }
+
+ // HTTP
+ {
+ let addressPort = TorProtocolService.readStringSetting(
+ TorStrings.configKeys.httpsProxy
+ );
+
+ if (addressPort) {
+ // address+port
+ let [proxyAddress, proxyPort] = parseAddrPort(addressPort);
+
+ // username:password
+ let proxyAuthenticator = TorProtocolService.readStringSetting(
+ TorStrings.configKeys.httpsProxyAuthenticator
+ );
+
+ let [proxyUsername, proxyPassword] = ["", ""];
+ if (proxyAuthenticator) {
+ [proxyUsername, proxyPassword] = parseUsernamePassword(
+ proxyAuthenticator
+ );
+ }
+
+ this._proxyType = TorProxyType.HTTPS;
+ this._proxyAddress = proxyAddress;
+ this._proxyPort = proxyPort;
+ this._proxyUsername = proxyUsername;
+ this._proxyPassword = proxyPassword;
+ }
+ }
+ // no proxy settings
+ } /* TorProxySettings::ReadFromTor() */
+
+ // attempts to write proxy settings to Tor daemon
+ // throws on error
+ writeSettings() {
+ let settingsObject = new Map();
+
+ // init proxy related settings to null so Tor daemon resets them
+ settingsObject.set(TorStrings.configKeys.socks4Proxy, null);
+ settingsObject.set(TorStrings.configKeys.socks5Proxy, null);
+ settingsObject.set(TorStrings.configKeys.socks5ProxyUsername, null);
+ settingsObject.set(TorStrings.configKeys.socks5ProxyPassword, null);
+ settingsObject.set(TorStrings.configKeys.httpsProxy, null);
+ settingsObject.set(TorStrings.configKeys.httpsProxyAuthenticator, null);
+
+ switch (this._proxyType) {
+ case TorProxyType.SOCKS4:
+ settingsObject.set(
+ TorStrings.configKeys.socks4Proxy,
+ `${this._proxyAddress}:${this._proxyPort}`
+ );
+ break;
+ case TorProxyType.SOCKS5:
+ settingsObject.set(
+ TorStrings.configKeys.socks5Proxy,
+ `${this._proxyAddress}:${this._proxyPort}`
+ );
+ settingsObject.set(
+ TorStrings.configKeys.socks5ProxyUsername,
+ this._proxyUsername
+ );
+ settingsObject.set(
+ TorStrings.configKeys.socks5ProxyPassword,
+ this._proxyPassword
+ );
+ break;
+ case TorProxyType.HTTPS:
+ settingsObject.set(
+ TorStrings.configKeys.httpsProxy,
+ `${this._proxyAddress}:${this._proxyPort}`
+ );
+ settingsObject.set(
+ TorStrings.configKeys.httpsProxyAuthenticator,
+ `${this._proxyUsername}:${this._proxyPassword}`
+ );
+ break;
+ }
+
+ TorProtocolService.writeSettings(settingsObject);
+ } /* TorProxySettings::WriteToTor() */
+}
+
+// factory methods for our various supported proxies
+function makeTorProxySettingsNone() {
+ return new TorProxySettings();
+}
+
+function makeTorProxySettingsSocks4(aProxyAddress, aProxyPort) {
+ let retval = new TorProxySettings();
+ retval._proxyType = TorProxyType.SOCKS4;
+ retval._proxyAddress = aProxyAddress;
+ retval._proxyPort = aProxyPort;
+ return retval;
+}
+
+function makeTorProxySettingsSocks5(
+ aProxyAddress,
+ aProxyPort,
+ aProxyUsername,
+ aProxyPassword
+) {
+ let retval = new TorProxySettings();
+ retval._proxyType = TorProxyType.SOCKS5;
+ retval._proxyAddress = aProxyAddress;
+ retval._proxyPort = aProxyPort;
+ retval._proxyUsername = aProxyUsername;
+ retval._proxyPassword = aProxyPassword;
+ return retval;
+}
+
+function makeTorProxySettingsHTTPS(
+ aProxyAddress,
+ aProxyPort,
+ aProxyUsername,
+ aProxyPassword
+) {
+ let retval = new TorProxySettings();
+ retval._proxyType = TorProxyType.HTTPS;
+ retval._proxyAddress = aProxyAddress;
+ retval._proxyPort = aProxyPort;
+ retval._proxyUsername = aProxyUsername;
+ retval._proxyPassword = aProxyPassword;
+ return retval;
+}
diff --git a/browser/components/torpreferences/jar.mn b/browser/components/torpreferences/jar.mn
new file mode 100644
index 000000000000..857bc9ee3eac
--- /dev/null
+++ b/browser/components/torpreferences/jar.mn
@@ -0,0 +1,14 @@
+browser.jar:
+ content/browser/torpreferences/parseFunctions.jsm (content/parseFunctions.jsm)
+ content/browser/torpreferences/requestBridgeDialog.xhtml (content/requestBridgeDialog.xhtml)
+ content/browser/torpreferences/requestBridgeDialog.jsm (content/requestBridgeDialog.jsm)
+ content/browser/torpreferences/torBridgeSettings.jsm (content/torBridgeSettings.jsm)
+ content/browser/torpreferences/torCategory.inc.xhtml (content/torCategory.inc.xhtml)
+ content/browser/torpreferences/torFirewallSettings.jsm (content/torFirewallSettings.jsm)
+ content/browser/torpreferences/torLogDialog.jsm (content/torLogDialog.jsm)
+ content/browser/torpreferences/torLogDialog.xhtml (content/torLogDialog.xhtml)
+ content/browser/torpreferences/torPane.js (content/torPane.js)
+ content/browser/torpreferences/torPane.xhtml (content/torPane.xhtml)
+ content/browser/torpreferences/torPreferences.css (content/torPreferences.css)
+ content/browser/torpreferences/torPreferencesIcon.svg (content/torPreferencesIcon.svg)
+ content/browser/torpreferences/torProxySettings.jsm (content/torProxySettings.jsm)
diff --git a/browser/components/torpreferences/moz.build b/browser/components/torpreferences/moz.build
new file mode 100644
index 000000000000..2661ad7cb9f3
--- /dev/null
+++ b/browser/components/torpreferences/moz.build
@@ -0,0 +1 @@
+JAR_MANIFESTS += ["jar.mn"]
diff --git a/browser/modules/BridgeDB.jsm b/browser/modules/BridgeDB.jsm
new file mode 100644
index 000000000000..2caa26b4e2e0
--- /dev/null
+++ b/browser/modules/BridgeDB.jsm
@@ -0,0 +1,110 @@
+"use strict";
+
+var EXPORTED_SYMBOLS = ["BridgeDB"];
+
+const { TorLauncherBridgeDB } = ChromeUtils.import(
+ "resource://torlauncher/modules/tl-bridgedb.jsm"
+);
+const { TorProtocolService } = ChromeUtils.import(
+ "resource:///modules/TorProtocolService.jsm"
+);
+const { TorStrings } = ChromeUtils.import("resource:///modules/TorStrings.jsm");
+
+var BridgeDB = {
+ _moatRequestor: null,
+ _currentCaptchaInfo: null,
+ _bridges: null,
+
+ get currentCaptchaImage() {
+ if (this._currentCaptchaInfo) {
+ return this._currentCaptchaInfo.captchaImage;
+ }
+ return null;
+ },
+
+ get currentBridges() {
+ return this._bridges;
+ },
+
+ submitCaptchaGuess(aCaptchaSolution) {
+ if (this._moatRequestor && this._currentCaptchaInfo) {
+ return this._moatRequestor
+ .finishFetch(
+ this._currentCaptchaInfo.transport,
+ this._currentCaptchaInfo.challenge,
+ aCaptchaSolution
+ )
+ .then(aBridgeInfo => {
+ this._moatRequestor.close();
+ this._moatRequestor = null;
+ this._currentCaptchaInfo = null;
+ this._bridges = aBridgeInfo.bridges;
+ // array of bridge strings
+ return this._bridges;
+ });
+ }
+
+ return new Promise((aResponse, aReject) => {
+ aReject(new Error("Invalid _moatRequestor or _currentCaptchaInfo"));
+ });
+ },
+
+ requestNewCaptchaImage(aProxyURI) {
+ // close and clear out existing state on captcha request
+ this.close();
+
+ let transportPlugins = TorProtocolService.readStringArraySetting(
+ TorStrings.configKeys.clientTransportPlugin
+ );
+
+ let meekClientPath;
+ let meekTransport; // We support both "meek" and "meek_lite".
+ let meekClientArgs;
+ // TODO: shouldn't this early out once meek settings are found?
+ for (const line of transportPlugins) {
+ // Parse each ClientTransportPlugin line and look for the meek or
+ // meek_lite transport. This code works a lot like the Tor daemon's
+ // parse_transport_line() function.
+ let tokens = line.split(" ");
+ if (tokens.length > 2 && tokens[1] == "exec") {
+ let transportArray = tokens[0].split(",").map(aStr => aStr.trim());
+ let transport = transportArray.find(
+ aTransport => aTransport === "meek"
+ );
+ if (!transport) {
+ transport = transportArray.find(
+ aTransport => aTransport === "meek_lite"
+ );
+ }
+ if (transport) {
+ meekTransport = transport;
+ meekClientPath = tokens[2];
+ meekClientArgs = tokens.slice(3);
+ }
+ }
+ }
+
+ this._moatRequestor = TorLauncherBridgeDB.createMoatRequestor();
+
+ return this._moatRequestor
+ .init(aProxyURI, meekTransport, meekClientPath, meekClientArgs)
+ .then(() => {
+ // TODO: get this from TorLauncherUtil
+ let bridgeType = "obfs4";
+ return this._moatRequestor.fetchBridges([bridgeType]);
+ })
+ .then(aCaptchaInfo => {
+ // cache off the current captcha info as the challenge is needed for response
+ this._currentCaptchaInfo = aCaptchaInfo;
+ return aCaptchaInfo.captchaImage;
+ });
+ },
+
+ close() {
+ if (this._moatRequestor) {
+ this._moatRequestor.close();
+ this._moatRequestor = null;
+ }
+ this._currentCaptchaInfo = null;
+ },
+};
diff --git a/browser/modules/TorProtocolService.jsm b/browser/modules/TorProtocolService.jsm
new file mode 100644
index 000000000000..b4e6ed9a3253
--- /dev/null
+++ b/browser/modules/TorProtocolService.jsm
@@ -0,0 +1,212 @@
+"use strict";
+
+var EXPORTED_SYMBOLS = ["TorProtocolService"];
+
+const { TorLauncherUtil } = ChromeUtils.import(
+ "resource://torlauncher/modules/tl-util.jsm"
+);
+
+var TorProtocolService = {
+ _tlps: Cc["@torproject.org/torlauncher-protocol-service;1"].getService(
+ Ci.nsISupports
+ ).wrappedJSObject,
+
+ // maintain a map of tor settings set by Tor Browser so that we don't
+ // repeatedly set the same key/values over and over
+ // this map contains string keys to primitive or array values
+ _settingsCache: new Map(),
+
+ _typeof(aValue) {
+ switch (typeof aValue) {
+ case "boolean":
+ return "boolean";
+ case "string":
+ return "string";
+ case "object":
+ if (aValue == null) {
+ return "null";
+ } else if (Array.isArray(aValue)) {
+ return "array";
+ }
+ return "object";
+ }
+ return "unknown";
+ },
+
+ _assertValidSettingKey(aSetting) {
+ // ensure the 'key' is a string
+ if (typeof aSetting != "string") {
+ throw new Error(
+ `Expected setting of type string but received ${typeof aSetting}`
+ );
+ }
+ },
+
+ _assertValidSetting(aSetting, aValue) {
+ this._assertValidSettingKey(aSetting);
+
+ const valueType = this._typeof(aValue);
+ switch (valueType) {
+ case "boolean":
+ case "string":
+ case "null":
+ return;
+ case "array":
+ for (const element of aValue) {
+ if (typeof element != "string") {
+ throw new Error(
+ `Setting '${aSetting}' array contains value of invalid type '${typeof element}'`
+ );
+ }
+ }
+ return;
+ default:
+ throw new Error(
+ `Invalid object type received for setting '${aSetting}'`
+ );
+ }
+ },
+
+ // takes a Map containing tor settings
+ // throws on error
+ writeSettings(aSettingsObj) {
+ // only write settings that have changed
+ let newSettings = new Map();
+ for (const [setting, value] of aSettingsObj) {
+ let saveSetting = false;
+
+ // make sure we have valid data here
+ this._assertValidSetting(setting, value);
+
+ if (!this._settingsCache.has(setting)) {
+ // no cached setting, so write
+ saveSetting = true;
+ } else {
+ const cachedValue = this._settingsCache.get(setting);
+ if (value != cachedValue) {
+ // compare arrays member-wise
+ if (Array.isArray(value) && Array.isArray(cachedValue)) {
+ if (value.length != cachedValue.length) {
+ saveSetting = true;
+ } else {
+ const arrayLength = value.length;
+ for (let i = 0; i < arrayLength; ++i) {
+ if (value[i] != cachedValue[i]) {
+ saveSetting = true;
+ break;
+ }
+ }
+ }
+ } else {
+ // some other different values
+ saveSetting = true;
+ }
+ }
+ }
+
+ if (saveSetting) {
+ newSettings.set(setting, value);
+ }
+ }
+
+ // only write if new setting to save
+ if (newSettings.size > 0) {
+ // convert settingsObject map to js object for torlauncher-protocol-service
+ let settingsObject = {};
+ for (const [setting, value] of newSettings) {
+ settingsObject[setting] = value;
+ }
+
+ let errorObject = {};
+ if (!this._tlps.TorSetConfWithReply(settingsObject, errorObject)) {
+ throw new Error(errorObject.details);
+ }
+
+ // save settings to cache after successfully writing to Tor
+ for (const [setting, value] of newSettings) {
+ this._settingsCache.set(setting, value);
+ }
+ }
+ },
+
+ _readSetting(aSetting) {
+ this._assertValidSettingKey(aSetting);
+ let reply = this._tlps.TorGetConf(aSetting);
+ if (this._tlps.TorCommandSucceeded(reply)) {
+ return reply.lineArray;
+ }
+ throw new Error(reply.lineArray.join("\n"));
+ },
+
+ _readBoolSetting(aSetting) {
+ let lineArray = this._readSetting(aSetting);
+ if (lineArray.length != 1) {
+ throw new Error(
+ `Expected an array with length 1 but received array of length ${
+ lineArray.length
+ }`
+ );
+ }
+
+ let retval = lineArray[0];
+ switch (retval) {
+ case "0":
+ return false;
+ case "1":
+ return true;
+ default:
+ throw new Error(`Expected boolean (1 or 0) but received '${retval}'`);
+ }
+ },
+
+ _readStringSetting(aSetting) {
+ let lineArray = this._readSetting(aSetting);
+ if (lineArray.length != 1) {
+ throw new Error(
+ `Expected an array with length 1 but received array of length ${
+ lineArray.length
+ }`
+ );
+ }
+ return lineArray[0];
+ },
+
+ _readStringArraySetting(aSetting) {
+ let lineArray = this._readSetting(aSetting);
+ return lineArray;
+ },
+
+ readBoolSetting(aSetting) {
+ let value = this._readBoolSetting(aSetting);
+ this._settingsCache.set(aSetting, value);
+ return value;
+ },
+
+ readStringSetting(aSetting) {
+ let value = this._readStringSetting(aSetting);
+ this._settingsCache.set(aSetting, value);
+ return value;
+ },
+
+ readStringArraySetting(aSetting) {
+ let value = this._readStringArraySetting(aSetting);
+ this._settingsCache.set(aSetting, value);
+ return value;
+ },
+
+ // writes current tor settings to disk
+ flushSettings() {
+ this._tlps.TorSendCommand("SAVECONF");
+ },
+
+ getLog() {
+ let countObj = { value: 0 };
+ let torLog = this._tlps.TorGetLog(countObj);
+ return torLog;
+ },
+
+ // true if we launched and control tor, false if using system tor
+ get ownsTorDaemon() {
+ return TorLauncherUtil.shouldStartAndOwnTor;
+ },
+};
diff --git a/browser/modules/moz.build b/browser/modules/moz.build
index 3774c12f4ef0..1f7c6bc4c67e 100644
--- a/browser/modules/moz.build
+++ b/browser/modules/moz.build
@@ -128,6 +128,7 @@ EXTRA_JS_MODULES += [
"AboutNewTab.jsm",
"AppUpdater.jsm",
"AsyncTabSwitcher.jsm",
+ "BridgeDB.jsm",
"BrowserUIUtils.jsm",
"BrowserUsageTelemetry.jsm",
"BrowserWindowTracker.jsm",
@@ -152,6 +153,7 @@ EXTRA_JS_MODULES += [
"TabsList.jsm",
"TabUnloader.jsm",
"ThemeVariableMap.jsm",
+ "TorProtocolService.jsm",
"TorStrings.jsm",
"TransientPrefs.jsm",
"webrtcUI.jsm",
1
0

[tor-browser/tor-browser-88.0.1-10.0-1] Omnibox: Add DDG, Startpage, Disconnect, Youtube, Twitter; remove Amazon, eBay, bing
by sysrqb@torproject.org 04 May '21
by sysrqb@torproject.org 04 May '21
04 May '21
commit 31c7933e57814d6019e0a8c795221b217e3d493c
Author: Mike Perry <mikeperry-git(a)torproject.org>
Date: Fri May 5 03:41:57 2017 -0700
Omnibox: Add DDG, Startpage, Disconnect, Youtube, Twitter; remove Amazon, eBay, bing
eBay and Amazon don't treat Tor users very well. Accounts often get locked and
payments reversed.
Also:
Bug 16322: Update DuckDuckGo search engine
We are replacing the clearnet URL with an onion service one (thanks to a
patch by a cypherpunk) and are removing the duplicated DDG search
engine. Duplicating DDG happend due to bug 1061736 where Mozilla
included DDG itself into Firefox. Interestingly, this caused breaking
the DDG search if JavaScript is disabled as the Mozilla engine, which
gets loaded earlier, does not use the html version of the search page.
Moreover, the Mozilla engine tracked where the users were searching from
by adding a respective parameter to the search query. We got rid of that
feature as well.
Also:
This fixes bug 20809: the DuckDuckGo team has changed its server-side
code in a way that lets users with JavaScript enabled use the default
landing page while those without JavaScript available get redirected
directly to the non-JS page. We adapt the search engine URLs
accordingly.
Also fixes bug 29798 by making sure we only specify the Google search
engine we actually ship an .xml file for.
Also regression tests.
---
.../search/extensions/ddg-onion/favicon.ico | Bin 0 -> 973 bytes
.../search/extensions/ddg-onion/manifest.json | 26 ++++++++++++++
.../components/search/extensions/ddg/favicon.ico | Bin 5430 -> 0 bytes
.../components/search/extensions/ddg/favicon.png | Bin 0 -> 1150 bytes
.../components/search/extensions/ddg/manifest.json | 38 ++-------------------
.../extensions/google/_locales/b-1-d/messages.json | 23 -------------
.../extensions/google/_locales/b-1-e/messages.json | 23 -------------
.../extensions/google/_locales/b-d/messages.json | 23 -------------
.../extensions/google/_locales/b-e/messages.json | 23 -------------
.../extensions/google/_locales/en/messages.json | 24 -------------
.../search/extensions/google/manifest.json | 17 +++++----
.../search/extensions/startpage/favicon.png | Bin 0 -> 1150 bytes
.../search/extensions/startpage/manifest.json | 26 ++++++++++++++
.../search/extensions/twitter/favicon.ico | Bin 0 -> 1650 bytes
.../search/extensions/twitter/manifest.json | 26 ++++++++++++++
.../extensions/wikipedia/_locales/NN/messages.json | 20 -----------
.../extensions/wikipedia/_locales/NO/messages.json | 20 -----------
.../extensions/wikipedia/_locales/af/messages.json | 20 -----------
.../extensions/wikipedia/_locales/an/messages.json | 20 -----------
.../extensions/wikipedia/_locales/ar/messages.json | 20 -----------
.../wikipedia/_locales/ast/messages.json | 20 -----------
.../extensions/wikipedia/_locales/az/messages.json | 20 -----------
.../wikipedia/_locales/be-tarask/messages.json | 20 -----------
.../extensions/wikipedia/_locales/be/messages.json | 20 -----------
.../extensions/wikipedia/_locales/bg/messages.json | 20 -----------
.../extensions/wikipedia/_locales/bn/messages.json | 20 -----------
.../extensions/wikipedia/_locales/br/messages.json | 20 -----------
.../extensions/wikipedia/_locales/bs/messages.json | 20 -----------
.../extensions/wikipedia/_locales/ca/messages.json | 20 -----------
.../extensions/wikipedia/_locales/cy/messages.json | 20 -----------
.../extensions/wikipedia/_locales/cz/messages.json | 20 -----------
.../extensions/wikipedia/_locales/da/messages.json | 20 -----------
.../extensions/wikipedia/_locales/de/messages.json | 20 -----------
.../wikipedia/_locales/dsb/messages.json | 20 -----------
.../extensions/wikipedia/_locales/el/messages.json | 20 -----------
.../extensions/wikipedia/_locales/en/messages.json | 20 -----------
.../extensions/wikipedia/_locales/eo/messages.json | 20 -----------
.../extensions/wikipedia/_locales/es/messages.json | 20 -----------
.../extensions/wikipedia/_locales/et/messages.json | 20 -----------
.../extensions/wikipedia/_locales/eu/messages.json | 20 -----------
.../extensions/wikipedia/_locales/fa/messages.json | 20 -----------
.../extensions/wikipedia/_locales/fi/messages.json | 20 -----------
.../extensions/wikipedia/_locales/fr/messages.json | 20 -----------
.../wikipedia/_locales/fy-NL/messages.json | 20 -----------
.../wikipedia/_locales/ga-IE/messages.json | 20 -----------
.../extensions/wikipedia/_locales/gd/messages.json | 20 -----------
.../extensions/wikipedia/_locales/gl/messages.json | 20 -----------
.../extensions/wikipedia/_locales/gn/messages.json | 20 -----------
.../extensions/wikipedia/_locales/gu/messages.json | 20 -----------
.../extensions/wikipedia/_locales/he/messages.json | 20 -----------
.../extensions/wikipedia/_locales/hi/messages.json | 20 -----------
.../extensions/wikipedia/_locales/hr/messages.json | 20 -----------
.../wikipedia/_locales/hsb/messages.json | 20 -----------
.../extensions/wikipedia/_locales/hu/messages.json | 20 -----------
.../extensions/wikipedia/_locales/hy/messages.json | 20 -----------
.../extensions/wikipedia/_locales/ia/messages.json | 20 -----------
.../extensions/wikipedia/_locales/id/messages.json | 20 -----------
.../extensions/wikipedia/_locales/is/messages.json | 20 -----------
.../extensions/wikipedia/_locales/it/messages.json | 20 -----------
.../extensions/wikipedia/_locales/ja/messages.json | 20 -----------
.../extensions/wikipedia/_locales/ka/messages.json | 20 -----------
.../wikipedia/_locales/kab/messages.json | 20 -----------
.../extensions/wikipedia/_locales/kk/messages.json | 20 -----------
.../extensions/wikipedia/_locales/km/messages.json | 20 -----------
.../extensions/wikipedia/_locales/kn/messages.json | 20 -----------
.../extensions/wikipedia/_locales/kr/messages.json | 20 -----------
.../wikipedia/_locales/lij/messages.json | 20 -----------
.../extensions/wikipedia/_locales/lo/messages.json | 20 -----------
.../extensions/wikipedia/_locales/lt/messages.json | 20 -----------
.../wikipedia/_locales/ltg/messages.json | 20 -----------
.../extensions/wikipedia/_locales/lv/messages.json | 20 -----------
.../extensions/wikipedia/_locales/mk/messages.json | 20 -----------
.../extensions/wikipedia/_locales/mr/messages.json | 20 -----------
.../extensions/wikipedia/_locales/ms/messages.json | 20 -----------
.../extensions/wikipedia/_locales/my/messages.json | 20 -----------
.../extensions/wikipedia/_locales/ne/messages.json | 20 -----------
.../extensions/wikipedia/_locales/nl/messages.json | 20 -----------
.../extensions/wikipedia/_locales/oc/messages.json | 20 -----------
.../extensions/wikipedia/_locales/pa/messages.json | 20 -----------
.../extensions/wikipedia/_locales/pl/messages.json | 20 -----------
.../extensions/wikipedia/_locales/pt/messages.json | 20 -----------
.../extensions/wikipedia/_locales/rm/messages.json | 20 -----------
.../extensions/wikipedia/_locales/ro/messages.json | 20 -----------
.../extensions/wikipedia/_locales/ru/messages.json | 20 -----------
.../extensions/wikipedia/_locales/si/messages.json | 20 -----------
.../extensions/wikipedia/_locales/sk/messages.json | 20 -----------
.../extensions/wikipedia/_locales/sl/messages.json | 20 -----------
.../extensions/wikipedia/_locales/sq/messages.json | 20 -----------
.../extensions/wikipedia/_locales/sr/messages.json | 20 -----------
.../wikipedia/_locales/sv-SE/messages.json | 20 -----------
.../extensions/wikipedia/_locales/ta/messages.json | 20 -----------
.../extensions/wikipedia/_locales/te/messages.json | 20 -----------
.../extensions/wikipedia/_locales/th/messages.json | 20 -----------
.../extensions/wikipedia/_locales/tl/messages.json | 20 -----------
.../extensions/wikipedia/_locales/tr/messages.json | 20 -----------
.../extensions/wikipedia/_locales/uk/messages.json | 20 -----------
.../extensions/wikipedia/_locales/ur/messages.json | 20 -----------
.../extensions/wikipedia/_locales/uz/messages.json | 20 -----------
.../extensions/wikipedia/_locales/vi/messages.json | 20 -----------
.../extensions/wikipedia/_locales/wo/messages.json | 20 -----------
.../wikipedia/_locales/zh-CN/messages.json | 20 -----------
.../wikipedia/_locales/zh-TW/messages.json | 20 -----------
.../search/extensions/wikipedia/manifest.json | 15 ++++----
.../components/search/extensions/yahoo/favicon.ico | Bin 0 -> 5430 bytes
.../search/extensions/yahoo/manifest.json | 28 +++++++++++++++
.../search/extensions/youtube/favicon.ico | Bin 0 -> 1150 bytes
.../search/extensions/youtube/manifest.json | 26 ++++++++++++++
tbb-tests/browser_tor_omnibox.js | 14 ++++++++
toolkit/components/search/SearchService.jsm | 28 ++++++---------
109 files changed, 175 insertions(+), 1925 deletions(-)
diff --git a/browser/components/search/extensions/ddg-onion/favicon.ico b/browser/components/search/extensions/ddg-onion/favicon.ico
new file mode 100644
index 000000000000..13c325f6585f
Binary files /dev/null and b/browser/components/search/extensions/ddg-onion/favicon.ico differ
diff --git a/browser/components/search/extensions/ddg-onion/manifest.json b/browser/components/search/extensions/ddg-onion/manifest.json
new file mode 100644
index 000000000000..4aa79e4abea0
--- /dev/null
+++ b/browser/components/search/extensions/ddg-onion/manifest.json
@@ -0,0 +1,26 @@
+{
+ "name": "DuckDuckGoOnion",
+ "description": "Duck Duck Go Onion",
+ "manifest_version": 2,
+ "version": "1.0",
+ "applications": {
+ "gecko": {
+ "id": "ddg-onion(a)search.mozilla.org"
+ }
+ },
+ "hidden": true,
+ "icons": {
+ "16": "favicon.ico"
+ },
+ "web_accessible_resources": [
+ "favicon.ico"
+ ],
+ "chrome_settings_overrides": {
+ "search_provider": {
+ "name": "DuckDuckGoOnion",
+ "search_url": "https://3g2upl4pq6kufc4m.onion",
+ "search_form": "https://3g2upl4pq6kufc4m.onion/?q={searchTerms}",
+ "search_url_get_params": "q={searchTerms}"
+ }
+ }
+}
\ No newline at end of file
diff --git a/browser/components/search/extensions/ddg/favicon.ico b/browser/components/search/extensions/ddg/favicon.ico
deleted file mode 100644
index dda80dfd88d5..000000000000
Binary files a/browser/components/search/extensions/ddg/favicon.ico and /dev/null differ
diff --git a/browser/components/search/extensions/ddg/favicon.png b/browser/components/search/extensions/ddg/favicon.png
new file mode 100644
index 000000000000..c853b95b89ef
Binary files /dev/null and b/browser/components/search/extensions/ddg/favicon.png differ
diff --git a/browser/components/search/extensions/ddg/manifest.json b/browser/components/search/extensions/ddg/manifest.json
index 782b860a679f..4a3b0ad20fe9 100644
--- a/browser/components/search/extensions/ddg/manifest.json
+++ b/browser/components/search/extensions/ddg/manifest.json
@@ -10,50 +10,18 @@
},
"hidden": true,
"icons": {
- "16": "favicon.ico"
+ "16": "favicon.png"
},
"web_accessible_resources": [
- "favicon.ico"
+ "favicon.png"
],
"chrome_settings_overrides": {
"search_provider": {
"keyword": ["@duckduckgo", "@ddg"],
"name": "DuckDuckGo",
- "search_url": "https://duckduckgo.com/",
+ "search_url": "https://duckduckgo.com",
"search_form": "https://duckduckgo.com/?q={searchTerms}",
"search_url_get_params": "q={searchTerms}",
- "params": [
- {
- "name": "t",
- "condition": "purpose",
- "purpose": "contextmenu",
- "value": "ffcm"
- },
- {
- "name": "t",
- "condition": "purpose",
- "purpose": "keyword",
- "value": "ffab"
- },
- {
- "name": "t",
- "condition": "purpose",
- "purpose": "searchbar",
- "value": "ffsb"
- },
- {
- "name": "t",
- "condition": "purpose",
- "purpose": "homepage",
- "value": "ffhp"
- },
- {
- "name": "t",
- "condition": "purpose",
- "purpose": "newtab",
- "value": "ffnt"
- }
- ],
"suggest_url": "https://ac.duckduckgo.com/ac/",
"suggest_url_get_params": "q={searchTerms}&type=list"
}
diff --git a/browser/components/search/extensions/google/_locales/b-1-d/messages.json b/browser/components/search/extensions/google/_locales/b-1-d/messages.json
deleted file mode 100644
index 1b9d05307d64..000000000000
--- a/browser/components/search/extensions/google/_locales/b-1-d/messages.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "extensionName": {
- "message": "Google"
- },
- "extensionDescription": {
- "message": "Google Search"
- },
- "searchUrl": {
- "message": "https://www.google.com/search"
- },
- "searchForm": {
- "message": "https://www.google.com/search?client=firefox-b-1-d&q={searchTerms}"
- },
- "suggestUrl": {
- "message": "https://www.google.com/complete/search?client=firefox&q={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "client=firefox-b-1-d&q={searchTerms}"
- },
- "channelPref": {
- "message": "google_channel_us"
- }
-}
diff --git a/browser/components/search/extensions/google/_locales/b-1-e/messages.json b/browser/components/search/extensions/google/_locales/b-1-e/messages.json
deleted file mode 100644
index b470cd844331..000000000000
--- a/browser/components/search/extensions/google/_locales/b-1-e/messages.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "extensionName": {
- "message": "Google"
- },
- "extensionDescription": {
- "message": "Google Search"
- },
- "searchUrl": {
- "message": "https://www.google.com/search"
- },
- "searchForm": {
- "message": "https://www.google.com/search?client=firefox-b-1-e&q={searchTerms}"
- },
- "suggestUrl": {
- "message": "https://www.google.com/complete/search?client=firefox&q={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "client=firefox-b-1-e&q={searchTerms}"
- },
- "channelPref": {
- "message": "google_channel_us"
- }
-}
diff --git a/browser/components/search/extensions/google/_locales/b-d/messages.json b/browser/components/search/extensions/google/_locales/b-d/messages.json
deleted file mode 100644
index a6423089d9f9..000000000000
--- a/browser/components/search/extensions/google/_locales/b-d/messages.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "extensionName": {
- "message": "Google"
- },
- "extensionDescription": {
- "message": "Google Search"
- },
- "searchUrl": {
- "message": "https://www.google.com/search"
- },
- "searchForm": {
- "message": "https://www.google.com/search?client=firefox-b-d&q={searchTerms}"
- },
- "suggestUrl": {
- "message": "https://www.google.com/complete/search?client=firefox&q={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "client=firefox-b-d&q={searchTerms}"
- },
- "channelPref": {
- "message": "google_channel_row"
- }
-}
diff --git a/browser/components/search/extensions/google/_locales/b-e/messages.json b/browser/components/search/extensions/google/_locales/b-e/messages.json
deleted file mode 100644
index 70939ee00074..000000000000
--- a/browser/components/search/extensions/google/_locales/b-e/messages.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "extensionName": {
- "message": "Google"
- },
- "extensionDescription": {
- "message": "Google Search"
- },
- "searchUrl": {
- "message": "https://www.google.com/search"
- },
- "searchForm": {
- "message": "https://www.google.com/search?client=firefox-b-e&q={searchTerms}"
- },
- "suggestUrl": {
- "message": "https://www.google.com/complete/search?client=firefox&q={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "client=firefox-b-e&q={searchTerms}"
- },
- "channelPref": {
- "message": "google_channel_row"
- }
-}
diff --git a/browser/components/search/extensions/google/_locales/en/messages.json b/browser/components/search/extensions/google/_locales/en/messages.json
deleted file mode 100644
index aeca0ef128b3..000000000000
--- a/browser/components/search/extensions/google/_locales/en/messages.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "extensionName": {
- "message": "Google"
- },
- "extensionDescription": {
- "message": "Google Search"
- },
- "searchUrl": {
- "message": "https://www.google.com/search"
- },
- "searchForm": {
- "message": "https://www.google.com/search?client=firefox-b-d&q={searchTerms}"
- },
- "suggestUrl": {
- "message": "https://www.google.com/complete/search?client=firefox&q={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "client=firefox-b-d&q={searchTerms}"
- },
- "channelPref": {
- "message": "google_channel_row"
- }
-
-}
diff --git a/browser/components/search/extensions/google/manifest.json b/browser/components/search/extensions/google/manifest.json
index d62049705ae2..965940517ba4 100644
--- a/browser/components/search/extensions/google/manifest.json
+++ b/browser/components/search/extensions/google/manifest.json
@@ -1,6 +1,6 @@
{
- "name": "__MSG_extensionName__",
- "description": "__MSG_extensionDescription__",
+ "name": "Google",
+ "description": "Google Search",
"manifest_version": 2,
"version": "1.1",
"applications": {
@@ -9,7 +9,6 @@
}
},
"hidden": true,
- "default_locale": "en",
"icons": {
"16": "favicon.ico"
},
@@ -19,18 +18,18 @@
"chrome_settings_overrides": {
"search_provider": {
"keyword": "@google",
- "name": "__MSG_extensionName__",
- "search_url": "__MSG_searchUrl__",
- "search_form": "__MSG_searchForm__",
- "suggest_url": "__MSG_suggestUrl__",
+ "name": "Google",
+ "search_url": "https://www.google.com/search",
+ "search_form": "https://www.google.com/search?client=firefox-b-d&q={searchTerms}",
+ "suggest_url": "https://www.google.com/complete/search?client=firefox&q={searchTerms}",
"params": [
{
"name": "channel",
"condition": "pref",
- "pref": "__MSG_channelPref__"
+ "pref": "google_channel_row"
}
],
- "search_url_get_params": "__MSG_searchUrlGetParams__"
+ "search_url_get_params": "client=firefox-b-d&q={searchTerms}"
}
}
}
diff --git a/browser/components/search/extensions/startpage/favicon.png b/browser/components/search/extensions/startpage/favicon.png
new file mode 100644
index 000000000000..44b94a986fd2
Binary files /dev/null and b/browser/components/search/extensions/startpage/favicon.png differ
diff --git a/browser/components/search/extensions/startpage/manifest.json b/browser/components/search/extensions/startpage/manifest.json
new file mode 100644
index 000000000000..c9bd9e1848d0
--- /dev/null
+++ b/browser/components/search/extensions/startpage/manifest.json
@@ -0,0 +1,26 @@
+{
+ "name": "Startpage",
+ "description": "Start Page",
+ "manifest_version": 2,
+ "version": "1.0",
+ "applications": {
+ "gecko": {
+ "id": "startpage(a)search.mozilla.org"
+ }
+ },
+ "hidden": true,
+ "icons": {
+ "16": "favicon.png"
+ },
+ "web_accessible_resources": [
+ "favicon.png"
+ ],
+ "chrome_settings_overrides": {
+ "search_provider": {
+ "name": "Startpage",
+ "search_url": "https://startpage.com/rto/search",
+ "search_form": "https://startpage.com/rto/search/",
+ "search_url_post_params": "q={searchTerms}"
+ }
+ }
+}
\ No newline at end of file
diff --git a/browser/components/search/extensions/twitter/favicon.ico b/browser/components/search/extensions/twitter/favicon.ico
new file mode 100644
index 000000000000..e5aaff437912
Binary files /dev/null and b/browser/components/search/extensions/twitter/favicon.ico differ
diff --git a/browser/components/search/extensions/twitter/manifest.json b/browser/components/search/extensions/twitter/manifest.json
new file mode 100644
index 000000000000..59714e0e1045
--- /dev/null
+++ b/browser/components/search/extensions/twitter/manifest.json
@@ -0,0 +1,26 @@
+{
+ "name": "Twitter",
+ "description": "Realtime Twitter Search",
+ "manifest_version": 2,
+ "version": "1.0",
+ "applications": {
+ "gecko": {
+ "id": "twitter(a)search.mozilla.org"
+ }
+ },
+ "hidden": true,
+ "icons": {
+ "16": "favicon.ico"
+ },
+ "web_accessible_resources": [
+ "favicon.ico"
+ ],
+ "chrome_settings_overrides": {
+ "search_provider": {
+ "name": "Twitter",
+ "search_url": "https://twitter.com/search",
+ "search_form": "https://twitter.com/search?q={searchTerms}&partner=Firefox&source=desktop-s…",
+ "search_url_get_params": "q={searchTerms}&partner=Firefox&source=desktop-search"
+ }
+ }
+}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/NN/messages.json b/browser/components/search/extensions/wikipedia/_locales/NN/messages.json
deleted file mode 100644
index e4ee66bc780d..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/NN/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedia (nn)"
- },
- "extensionDescription": {
- "message": "Wikipedia, det frie oppslagsverket"
- },
- "searchUrl": {
- "message": "https://nn.wikipedia.org/wiki/Spesial:Søk"
- },
- "searchForm": {
- "message": "https://nn.wikipedia.org/wiki/Spesial:Søk?search={searchTerms}&sourceid=Moz…"
- },
- "suggestUrl": {
- "message": "https://nn.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/NO/messages.json b/browser/components/search/extensions/wikipedia/_locales/NO/messages.json
deleted file mode 100644
index ec016ac7337e..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/NO/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedia (no)"
- },
- "extensionDescription": {
- "message": "Wikipedia, den frie encyklopedi"
- },
- "searchUrl": {
- "message": "https://no.wikipedia.org/wiki/Spesial:Søk"
- },
- "searchForm": {
- "message": "https://no.wikipedia.org/wiki/Spesial:Søk?search={searchTerms}&sourceid=Moz…"
- },
- "suggestUrl": {
- "message": "https://no.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/af/messages.json b/browser/components/search/extensions/wikipedia/_locales/af/messages.json
deleted file mode 100644
index 8cf9de8ac9b3..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/af/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedia (af)"
- },
- "extensionDescription": {
- "message": "Wikipedia, die vrye ensiklopedie"
- },
- "searchUrl": {
- "message": "https://af.wikipedia.org/wiki/Spesiaal:Soek"
- },
- "searchForm": {
- "message": "https://af.wikipedia.org/wiki/Spesiaal:Soek?search={searchTerms}&sourceid=M…"
- },
- "suggestUrl": {
- "message": "https://af.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/an/messages.json b/browser/components/search/extensions/wikipedia/_locales/an/messages.json
deleted file mode 100644
index e8cce665c96e..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/an/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Biquipedia (an)"
- },
- "extensionDescription": {
- "message": "A enciclopedia Libre"
- },
- "searchUrl": {
- "message": "https://an.wikipedia.org/wiki/Especial:Mirar"
- },
- "searchForm": {
- "message": "https://an.wikipedia.org/wiki/Especial:Mirar?search={searchTerms}&sourceid=…"
- },
- "suggestUrl": {
- "message": "https://an.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/ar/messages.json b/browser/components/search/extensions/wikipedia/_locales/ar/messages.json
deleted file mode 100644
index de90b2a2055e..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/ar/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "ويكيبيديا (ar)"
- },
- "extensionDescription": {
- "message": "ويكيبيديا (ar)"
- },
- "searchUrl": {
- "message": "https://ar.wikipedia.org/wiki/خاص:بحث"
- },
- "searchForm": {
- "message": "https://ar.wikipedia.org/wiki/خاص:بحث?search={searchTerms}&sourceid=Mozilla…"
- },
- "suggestUrl": {
- "message": "https://ar.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/ast/messages.json b/browser/components/search/extensions/wikipedia/_locales/ast/messages.json
deleted file mode 100644
index a127ba07f29b..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/ast/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedia (ast)"
- },
- "extensionDescription": {
- "message": "La enciclopedia llibre"
- },
- "searchUrl": {
- "message": "https://ast.wikipedia.org/wiki/Especial:Gueta"
- },
- "searchForm": {
- "message": "https://ast.wikipedia.org/wiki/Especial:Gueta?search={searchTerms}&sourceid…"
- },
- "suggestUrl": {
- "message": "https://ast.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/az/messages.json b/browser/components/search/extensions/wikipedia/_locales/az/messages.json
deleted file mode 100644
index f551a717e6d3..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/az/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Vikipediya (az)"
- },
- "extensionDescription": {
- "message": "Vikipediya, açıq ensiklopediya"
- },
- "searchUrl": {
- "message": "https://az.wikipedia.org/wiki/Xüsusi:Axtar"
- },
- "searchForm": {
- "message": "https://az.wikipedia.org/wiki/Xüsusi:Axtar?search={searchTerms}&sourceid=Mo…"
- },
- "suggestUrl": {
- "message": "https://az.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/be-tarask/messages.json b/browser/components/search/extensions/wikipedia/_locales/be-tarask/messages.json
deleted file mode 100644
index aecfecf2fb19..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/be-tarask/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Вікіпэдыя (be-tarask)"
- },
- "extensionDescription": {
- "message": "Вікіпэдыя, вольная энцыкляпэдыя"
- },
- "searchUrl": {
- "message": "https://be-tarask.wikipedia.org/wiki/Спэцыяльныя:Пошук"
- },
- "searchForm": {
- "message": "https://be-tarask.wikipedia.org/wiki/Спэцыяльныя:Пошук?search={searchTerms}…"
- },
- "suggestUrl": {
- "message": "https://be-tarask.wikipedia.org/w/api.php?action=opensearch&search={searchT…"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/be/messages.json b/browser/components/search/extensions/wikipedia/_locales/be/messages.json
deleted file mode 100644
index 6aa763451e67..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/be/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Вікіпедыя (be)"
- },
- "extensionDescription": {
- "message": "Вікіпедыя, свабодная энцыклапедыя"
- },
- "searchUrl": {
- "message": "https://be.wikipedia.org/wiki/Адмысловае:Search"
- },
- "searchForm": {
- "message": "https://be.wikipedia.org/wiki/Адмысловае:Search?search={searchTerms}&source…"
- },
- "suggestUrl": {
- "message": "https://be.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/bg/messages.json b/browser/components/search/extensions/wikipedia/_locales/bg/messages.json
deleted file mode 100644
index 896a85d66b87..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/bg/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Уикипедия (bg)"
- },
- "extensionDescription": {
- "message": "Уикипедия, свободната енциклоподия"
- },
- "searchUrl": {
- "message": "https://bg.wikipedia.org/wiki/Специални:Търсене"
- },
- "searchForm": {
- "message": "https://bg.wikipedia.org/wiki/Специални:Търсене?search={searchTerms}&source…"
- },
- "suggestUrl": {
- "message": "https://bg.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/bn/messages.json b/browser/components/search/extensions/wikipedia/_locales/bn/messages.json
deleted file mode 100644
index fe9887ed1938..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/bn/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "উইকিপিডিয়া (bn)"
- },
- "extensionDescription": {
- "message": "উইকিপিডিয়া, মুক্ত বিশ্বকোষ"
- },
- "searchUrl": {
- "message": "https://bn.wikipedia.org/wiki/বিশেষ:Search"
- },
- "searchForm": {
- "message": "https://bn.wikipedia.org/wiki/বিশেষ:Search?search={searchTerms}&sourceid=Mo…"
- },
- "suggestUrl": {
- "message": "https://bn.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/br/messages.json b/browser/components/search/extensions/wikipedia/_locales/br/messages.json
deleted file mode 100644
index 33869ce8e752..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/br/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedia (br)"
- },
- "extensionDescription": {
- "message": "Wikipedia, an holloueziadur digor"
- },
- "searchUrl": {
- "message": "https://br.wikipedia.org/wiki/Dibar:Klask"
- },
- "searchForm": {
- "message": "https://br.wikipedia.org/wiki/Dibar:Klask?search={searchTerms}&sourceid=Moz…"
- },
- "suggestUrl": {
- "message": "https://br.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/bs/messages.json b/browser/components/search/extensions/wikipedia/_locales/bs/messages.json
deleted file mode 100644
index 746150e3d8e8..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/bs/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedia (bs)"
- },
- "extensionDescription": {
- "message": "Slobodna enciklopedija"
- },
- "searchUrl": {
- "message": "https://bs.wikipedia.org/wiki/Posebno:Pretraga"
- },
- "searchForm": {
- "message": "https://bs.wikipedia.org/wiki/Posebno:Pretraga?search={searchTerms}&sourcei…"
- },
- "suggestUrl": {
- "message": "https://bs.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/ca/messages.json b/browser/components/search/extensions/wikipedia/_locales/ca/messages.json
deleted file mode 100644
index 151ec1a71ba5..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/ca/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Viquipèdia (ca)"
- },
- "extensionDescription": {
- "message": "L'enciclopèdia lliure"
- },
- "searchUrl": {
- "message": "https://ca.wikipedia.org/wiki/Especial:Cerca"
- },
- "searchForm": {
- "message": "https://ca.wikipedia.org/wiki/Especial:Cerca?search={searchTerms}&sourceid=…"
- },
- "suggestUrl": {
- "message": "https://ca.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/cy/messages.json b/browser/components/search/extensions/wikipedia/_locales/cy/messages.json
deleted file mode 100644
index cfed7c73be34..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/cy/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wicipedia (cy)"
- },
- "extensionDescription": {
- "message": "Wicipedia, Y Gwyddioniadur Rhydd"
- },
- "searchUrl": {
- "message": "https://cy.wikipedia.org/wiki/Arbennig:Search"
- },
- "searchForm": {
- "message": "https://cy.wikipedia.org/wiki/Arbennig:Search?search={searchTerms}&sourceid…"
- },
- "suggestUrl": {
- "message": "https://cy.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/cz/messages.json b/browser/components/search/extensions/wikipedia/_locales/cz/messages.json
deleted file mode 100644
index 12f7eb22d711..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/cz/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedie (cs)"
- },
- "extensionDescription": {
- "message": "Wikipedia, svobodná encyclopedie"
- },
- "searchUrl": {
- "message": "https://cs.wikipedia.org/wiki/Speciální:Hledání"
- },
- "searchForm": {
- "message": "https://cs.wikipedia.org/wiki/Speciální:Hledání?search={searchTerms}&source…"
- },
- "suggestUrl": {
- "message": "https://cs.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/da/messages.json b/browser/components/search/extensions/wikipedia/_locales/da/messages.json
deleted file mode 100644
index 801d5a5183cc..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/da/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedia (da)"
- },
- "extensionDescription": {
- "message": "Wikipedia, den frie encyklopædi"
- },
- "searchUrl": {
- "message": "https://da.wikipedia.org/wiki/Speciel:Søgning"
- },
- "searchForm": {
- "message": "https://da.wikipedia.org/wiki/Speciel:Søgning?search={searchTerms}&sourceid…"
- },
- "suggestUrl": {
- "message": "https://da.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/de/messages.json b/browser/components/search/extensions/wikipedia/_locales/de/messages.json
deleted file mode 100644
index 0e6bbe8905ca..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/de/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedia (de)"
- },
- "extensionDescription": {
- "message": "Wikipedia, die freie Enzyklopädie"
- },
- "searchUrl": {
- "message": "https://de.wikipedia.org/wiki/Spezial:Suche"
- },
- "searchForm": {
- "message": "https://de.wikipedia.org/wiki/Spezial:Suche?search={searchTerms}&sourceid=M…"
- },
- "suggestUrl": {
- "message": "https://de.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/dsb/messages.json b/browser/components/search/extensions/wikipedia/_locales/dsb/messages.json
deleted file mode 100644
index ffca44b5f7fb..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/dsb/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedija (dsb)"
- },
- "extensionDescription": {
- "message": "Wikipedija, lichotna encyklopedija"
- },
- "searchUrl": {
- "message": "https://dsb.wikipedia.org/wiki/Specialne:Pytaś"
- },
- "searchForm": {
- "message": "https://dsb.wikipedia.org/wiki/Specialne:Pytaś?search={searchTerms}&sourcei…"
- },
- "suggestUrl": {
- "message": "https://dsb.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/el/messages.json b/browser/components/search/extensions/wikipedia/_locales/el/messages.json
deleted file mode 100644
index 95b48f3d9ca7..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/el/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedia (el)"
- },
- "extensionDescription": {
- "message": "Βικιπαίδεια, η ελεύθερη εγκυκλοπαίδεια"
- },
- "searchUrl": {
- "message": "https://el.wikipedia.org/wiki/Ειδικό:Αναζήτηση"
- },
- "searchForm": {
- "message": "https://el.wikipedia.org/wiki/Ειδικό:Αναζήτηση?search={searchTerms}&sourcei…"
- },
- "suggestUrl": {
- "message": "https://el.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/en/messages.json b/browser/components/search/extensions/wikipedia/_locales/en/messages.json
deleted file mode 100644
index 0de3c9a8071a..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/en/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedia (en)"
- },
- "extensionDescription": {
- "message": "Wikipedia, the Free Encyclopedia"
- },
- "searchUrl": {
- "message": "https://en.wikipedia.org/wiki/Special:Search"
- },
- "searchForm": {
- "message": "https://en.wikipedia.org/wiki/Special:Search?search={searchTerms}&sourceid=…"
- },
- "suggestUrl": {
- "message": "https://en.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/eo/messages.json b/browser/components/search/extensions/wikipedia/_locales/eo/messages.json
deleted file mode 100644
index 10aa88dd11ba..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/eo/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Vikipedio (eo)"
- },
- "extensionDescription": {
- "message": "Vikipedio, la libera enciklopedio"
- },
- "searchUrl": {
- "message": "https://eo.wikipedia.org/wiki/Specialaĵo:Serĉi"
- },
- "searchForm": {
- "message": "https://eo.wikipedia.org/wiki/Specialaĵo:Serĉi?search={searchTerms}&sourcei…"
- },
- "suggestUrl": {
- "message": "https://eo.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/es/messages.json b/browser/components/search/extensions/wikipedia/_locales/es/messages.json
deleted file mode 100644
index 09ec1f757657..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/es/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedia (es)"
- },
- "extensionDescription": {
- "message": "Wikipedia, la enciclopedia libre"
- },
- "searchUrl": {
- "message": "https://es.wikipedia.org/wiki/Especial:Buscar"
- },
- "searchForm": {
- "message": "https://es.wikipedia.org/wiki/Especial:Buscar?search={searchTerms}&sourceid…"
- },
- "suggestUrl": {
- "message": "https://es.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/et/messages.json b/browser/components/search/extensions/wikipedia/_locales/et/messages.json
deleted file mode 100644
index 91363fbb392b..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/et/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Vikipeedia (et)"
- },
- "extensionDescription": {
- "message": "Vikipeedia, vaba entsüklopeedia"
- },
- "searchUrl": {
- "message": "https://et.wikipedia.org/wiki/Eri:Otsimine"
- },
- "searchForm": {
- "message": "https://et.wikipedia.org/wiki/Eri:Otsimine?search={searchTerms}&sourceid=Mo…"
- },
- "suggestUrl": {
- "message": "https://et.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/eu/messages.json b/browser/components/search/extensions/wikipedia/_locales/eu/messages.json
deleted file mode 100644
index 1bd7027dec54..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/eu/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedia (eu)"
- },
- "extensionDescription": {
- "message": "Wikipedia, entziklopedia askea"
- },
- "searchUrl": {
- "message": "https://eu.wikipedia.org/wiki/Berezi:Bilatu"
- },
- "searchForm": {
- "message": "https://eu.wikipedia.org/wiki/Berezi:Bilatu?search={searchTerms}&sourceid=M…"
- },
- "suggestUrl": {
- "message": "https://eu.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/fa/messages.json b/browser/components/search/extensions/wikipedia/_locales/fa/messages.json
deleted file mode 100644
index 9fdc964a1e0b..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/fa/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "ویکیپدیا (fa)"
- },
- "extensionDescription": {
- "message": "ویکیپدیا، دانشنامهٔ آزاد"
- },
- "searchUrl": {
- "message": "https://fa.wikipedia.org/wiki/ویژه:جستجو"
- },
- "searchForm": {
- "message": "https://fa.wikipedia.org/wiki/ویژه:جستجو?search={searchTerms}&sourceid=Mozi…"
- },
- "suggestUrl": {
- "message": "https://fa.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/fi/messages.json b/browser/components/search/extensions/wikipedia/_locales/fi/messages.json
deleted file mode 100644
index 17a9cbe22c42..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/fi/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedia (fi)"
- },
- "extensionDescription": {
- "message": "Wikipedia (fi), vapaa tietosanakirja"
- },
- "searchUrl": {
- "message": "https://fi.wikipedia.org/wiki/Toiminnot:Haku"
- },
- "searchForm": {
- "message": "https://fi.wikipedia.org/wiki/Toiminnot:Haku?search={searchTerms}&sourceid=…"
- },
- "suggestUrl": {
- "message": "https://fi.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/fr/messages.json b/browser/components/search/extensions/wikipedia/_locales/fr/messages.json
deleted file mode 100644
index 33dcbe9dc502..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/fr/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipédia (fr)"
- },
- "extensionDescription": {
- "message": "Wikipédia, l'encyclopédie libre"
- },
- "searchUrl": {
- "message": "https://fr.wikipedia.org/wiki/Spécial:Recherche"
- },
- "searchForm": {
- "message": "https://fr.wikipedia.org/wiki/Spécial:Recherche?search={searchTerms}&source…"
- },
- "suggestUrl": {
- "message": "https://fr.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/fy-NL/messages.json b/browser/components/search/extensions/wikipedia/_locales/fy-NL/messages.json
deleted file mode 100644
index f350162fbbaf..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/fy-NL/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedy (fy)"
- },
- "extensionDescription": {
- "message": "De fergese ensyklopedy"
- },
- "searchUrl": {
- "message": "https://fy.wikipedia.org/wiki/Wiki:Sykje"
- },
- "searchForm": {
- "message": "https://fy.wikipedia.org/wiki/Wiki:Sykje?search={searchTerms}&sourceid=Mozi…"
- },
- "suggestUrl": {
- "message": "https://fy.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/ga-IE/messages.json b/browser/components/search/extensions/wikipedia/_locales/ga-IE/messages.json
deleted file mode 100644
index 994ea723c6da..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/ga-IE/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Vicipéid (ga)"
- },
- "extensionDescription": {
- "message": "Vicipéid, an Chiclipéid Shaor"
- },
- "searchUrl": {
- "message": "https://ga.wikipedia.org/wiki/Speisialta:Search"
- },
- "searchForm": {
- "message": "https://ga.wikipedia.org/wiki/Speisialta:Search?search={searchTerms}&source…"
- },
- "suggestUrl": {
- "message": "https://ga.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/gd/messages.json b/browser/components/search/extensions/wikipedia/_locales/gd/messages.json
deleted file mode 100644
index f16f16fb4a02..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/gd/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Uicipeid (gd)"
- },
- "extensionDescription": {
- "message": "Wikipedia, An leabhar mòr-eòlais"
- },
- "searchUrl": {
- "message": "https://gd.wikipedia.org/wiki/Sònraichte:Search"
- },
- "searchForm": {
- "message": "https://gd.wikipedia.org/wiki/Sònraichte:Search?search={searchTerms}&source…"
- },
- "suggestUrl": {
- "message": "https://gd.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/gl/messages.json b/browser/components/search/extensions/wikipedia/_locales/gl/messages.json
deleted file mode 100644
index 88880bffc3d9..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/gl/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedia (gl)"
- },
- "extensionDescription": {
- "message": "Wikipedia, a enciclopedia libre"
- },
- "searchUrl": {
- "message": "https://gl.wikipedia.org/wiki/Especial:Procurar"
- },
- "searchForm": {
- "message": "https://gl.wikipedia.org/wiki/Especial:Procurar?search={searchTerms}&source…"
- },
- "suggestUrl": {
- "message": "https://gl.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/gn/messages.json b/browser/components/search/extensions/wikipedia/_locales/gn/messages.json
deleted file mode 100644
index 5efc5ed74a95..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/gn/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Vikipetã (gn)"
- },
- "extensionDescription": {
- "message": "Vikipetã, opaite tembikuaa hekosãsóva renda"
- },
- "searchUrl": {
- "message": "https://gn.wikipedia.org/wiki/Mba'echĩchĩ:Buscar"
- },
- "searchForm": {
- "message": "https://gn.wikipedia.org/wiki/Mba'echĩchĩ:Buscar?search={searchTerms}&sourceid=Mozilla-search"
- },
- "suggestUrl": {
- "message": "https://gn.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/gu/messages.json b/browser/components/search/extensions/wikipedia/_locales/gu/messages.json
deleted file mode 100644
index 3d2f68826fc5..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/gu/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "વિકિપીડિયા (gu)"
- },
- "extensionDescription": {
- "message": "વીકીપીડિયા, મુક્ત એનસાયક્લોપીડિયા"
- },
- "searchUrl": {
- "message": "https://gu.wikipedia.org/wiki/વિશેષ:શોધ"
- },
- "searchForm": {
- "message": "https://gu.wikipedia.org/wiki/વિશેષ:શોધ?search={searchTerms}&sourceid=Mozil…"
- },
- "suggestUrl": {
- "message": "https://gu.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/he/messages.json b/browser/components/search/extensions/wikipedia/_locales/he/messages.json
deleted file mode 100644
index 1f8471e980f0..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/he/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "ויקיפדיה"
- },
- "extensionDescription": {
- "message": "ויקיפדיה"
- },
- "searchUrl": {
- "message": "https://he.wikipedia.org/wiki/מיוחד:חיפוש"
- },
- "searchForm": {
- "message": "https://he.wikipedia.org/wiki/מיוחד:חיפוש?search={searchTerms}&sourceid=Moz…"
- },
- "suggestUrl": {
- "message": "https://he.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/hi/messages.json b/browser/components/search/extensions/wikipedia/_locales/hi/messages.json
deleted file mode 100644
index f3b7d14eafa0..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/hi/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "विकिपीडिया (hi)"
- },
- "extensionDescription": {
- "message": "विकिपीडिया (हिन्दी)"
- },
- "searchUrl": {
- "message": "https://hi.wikipedia.org/wiki/विशेष:खोज"
- },
- "searchForm": {
- "message": "https://hi.wikipedia.org/wiki/विशेष:खोज?search={searchTerms}&sourceid=Mozil…"
- },
- "suggestUrl": {
- "message": "https://hi.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/hr/messages.json b/browser/components/search/extensions/wikipedia/_locales/hr/messages.json
deleted file mode 100644
index 18a6177efcca..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/hr/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedija (hr)"
- },
- "extensionDescription": {
- "message": "Wikipedija, slobodna enciklopedija"
- },
- "searchUrl": {
- "message": "https://hr.wikipedia.org/wiki/Posebno:Traži"
- },
- "searchForm": {
- "message": "https://hr.wikipedia.org/wiki/Posebno:Traži?search={searchTerms}&sourceid=M…"
- },
- "suggestUrl": {
- "message": "https://hr.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/hsb/messages.json b/browser/components/search/extensions/wikipedia/_locales/hsb/messages.json
deleted file mode 100644
index d4e62836e6e9..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/hsb/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedija (hsb)"
- },
- "extensionDescription": {
- "message": "Wikipedija, swobodna encyklopedija"
- },
- "searchUrl": {
- "message": "https://hsb.wikipedia.org/wiki/Specialnje:Pytać"
- },
- "searchForm": {
- "message": "https://hsb.wikipedia.org/wiki/Specialnje:Pytać?search={searchTerms}&source…"
- },
- "suggestUrl": {
- "message": "https://hsb.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/hu/messages.json b/browser/components/search/extensions/wikipedia/_locales/hu/messages.json
deleted file mode 100644
index 68300c48a6f3..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/hu/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipédia (hu)"
- },
- "extensionDescription": {
- "message": "Wikipedia, a szabad enciklopédia"
- },
- "searchUrl": {
- "message": "https://hu.wikipedia.org/wiki/Speciális:Keresés"
- },
- "searchForm": {
- "message": "https://hu.wikipedia.org/wiki/Speciális:Keresés?search={searchTerms}&source…"
- },
- "suggestUrl": {
- "message": "https://hu.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/hy/messages.json b/browser/components/search/extensions/wikipedia/_locales/hy/messages.json
deleted file mode 100644
index 56c2ae2c641b..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/hy/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedia (hy)"
- },
- "extensionDescription": {
- "message": "Վիքիփեդիա՝ ազատ հանրագիտարան"
- },
- "searchUrl": {
- "message": "https://hy.wikipedia.org/wiki/Սպասարկող:Որոնել"
- },
- "searchForm": {
- "message": "https://hy.wikipedia.org/wiki/Սպասարկող:Որոնել?search={searchTerms}&sourcei…"
- },
- "suggestUrl": {
- "message": "https://hy.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/ia/messages.json b/browser/components/search/extensions/wikipedia/_locales/ia/messages.json
deleted file mode 100644
index 6d997ae8fc81..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/ia/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedia (ia)"
- },
- "extensionDescription": {
- "message": "Wikipedia, le encyclopedia libere"
- },
- "searchUrl": {
- "message": "https://ia.wikipedia.org/wiki/Special:Recerca"
- },
- "searchForm": {
- "message": "https://ia.wikipedia.org/wiki/Special:Recerca?search={searchTerms}&sourceid…"
- },
- "suggestUrl": {
- "message": "https://ia.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/id/messages.json b/browser/components/search/extensions/wikipedia/_locales/id/messages.json
deleted file mode 100644
index 1d35e71b956d..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/id/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedia (id)"
- },
- "extensionDescription": {
- "message": "Wikipedia, ensiklopedia bebas"
- },
- "searchUrl": {
- "message": "https://id.wikipedia.org/wiki/Istimewa:Pencarian"
- },
- "searchForm": {
- "message": "https://id.wikipedia.org/wiki/Istimewa:Pencarian?search={searchTerms}&sourc…"
- },
- "suggestUrl": {
- "message": "https://id.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/is/messages.json b/browser/components/search/extensions/wikipedia/_locales/is/messages.json
deleted file mode 100644
index f722d88187de..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/is/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedia (is)"
- },
- "extensionDescription": {
- "message": "Wikipedia, the free encyclopedia"
- },
- "searchUrl": {
- "message": "https://is.wikipedia.org/wiki/Kerfissíða:Leit"
- },
- "searchForm": {
- "message": "https://is.wikipedia.org/wiki/Kerfissíða:Leit?search={searchTerms}&sourceid…"
- },
- "suggestUrl": {
- "message": "https://is.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/it/messages.json b/browser/components/search/extensions/wikipedia/_locales/it/messages.json
deleted file mode 100644
index 2ca645740f87..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/it/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedia (it)"
- },
- "extensionDescription": {
- "message": "Wikipedia, l'enciclopedia libera"
- },
- "searchUrl": {
- "message": "https://it.wikipedia.org/wiki/Speciale:Ricerca"
- },
- "searchForm": {
- "message": "https://it.wikipedia.org/wiki/Speciale:Ricerca?search={searchTerms}&sourcei…"
- },
- "suggestUrl": {
- "message": "https://it.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/ja/messages.json b/browser/components/search/extensions/wikipedia/_locales/ja/messages.json
deleted file mode 100644
index 7215e68768f0..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/ja/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedia (ja)"
- },
- "extensionDescription": {
- "message": "Wikipedia - フリー百科事典"
- },
- "searchUrl": {
- "message": "https://ja.wikipedia.org/wiki/特別:検索"
- },
- "searchForm": {
- "message": "https://ja.wikipedia.org/wiki/特別:検索?search={searchTerms}&sourceid=Mozilla-s…"
- },
- "suggestUrl": {
- "message": "https://ja.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/ka/messages.json b/browser/components/search/extensions/wikipedia/_locales/ka/messages.json
deleted file mode 100644
index c460a093e5e4..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/ka/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "ვიკიპედია (ka)"
- },
- "extensionDescription": {
- "message": "ვიკიპედია, თავისუფალი ენციკლოპედია"
- },
- "searchUrl": {
- "message": "https://ka.wikipedia.org/wiki/სპეციალური:ძიება"
- },
- "searchForm": {
- "message": "https://ka.wikipedia.org/wiki/სპეციალური:ძიება?search={searchTerms}&sourcei…"
- },
- "suggestUrl": {
- "message": "https://ka.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/kab/messages.json b/browser/components/search/extensions/wikipedia/_locales/kab/messages.json
deleted file mode 100644
index 3cf743b616fe..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/kab/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedia (kab)"
- },
- "extensionDescription": {
- "message": "Wikipedia, tasanayt tilellit"
- },
- "searchUrl": {
- "message": "https://kab.wikipedia.org/wiki/Uslig:Search"
- },
- "searchForm": {
- "message": "https://kab.wikipedia.org/wiki/Uslig:Search?search={searchTerms}&sourceid=M…"
- },
- "suggestUrl": {
- "message": "https://kab.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/kk/messages.json b/browser/components/search/extensions/wikipedia/_locales/kk/messages.json
deleted file mode 100644
index 0844cca0d7e1..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/kk/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Уикипедия (kk)"
- },
- "extensionDescription": {
- "message": "Уикипедия (kk)"
- },
- "searchUrl": {
- "message": "https://kk.wikipedia.org/wiki/Арнайы:Іздеу"
- },
- "searchForm": {
- "message": "https://kk.wikipedia.org/wiki/Арнайы:Іздеу?search={searchTerms}&sourceid=Mo…"
- },
- "suggestUrl": {
- "message": "https://kk.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/km/messages.json b/browser/components/search/extensions/wikipedia/_locales/km/messages.json
deleted file mode 100644
index 0f0a0880e188..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/km/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "វីគីភីឌា (km)"
- },
- "extensionDescription": {
- "message": "វីគីភីឌា សព្វវចនាធិប្បាយសេរី"
- },
- "searchUrl": {
- "message": "https://km.wikipedia.org/wiki/ពិសេស:ស្វែងរក"
- },
- "searchForm": {
- "message": "https://km.wikipedia.org/wiki/ពិសេស:ស្វែងរក?search={searchTerms}&sourceid=M…"
- },
- "suggestUrl": {
- "message": "https://km.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/kn/messages.json b/browser/components/search/extensions/wikipedia/_locales/kn/messages.json
deleted file mode 100644
index 379ef20085a3..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/kn/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedia (kn)"
- },
- "extensionDescription": {
- "message": "Wikipedia, the free encyclopedia"
- },
- "searchUrl": {
- "message": "https://kn.wikipedia.org/wiki/ವಿಶೇಷ:Search"
- },
- "searchForm": {
- "message": "https://kn.wikipedia.org/wiki/ವಿಶೇಷ:Search?search={searchTerms}&sourceid=Mo…"
- },
- "suggestUrl": {
- "message": "https://kn.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/kr/messages.json b/browser/components/search/extensions/wikipedia/_locales/kr/messages.json
deleted file mode 100644
index 54296cac62bd..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/kr/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "위키백과 (ko)"
- },
- "extensionDescription": {
- "message": "Wikipedia, the free encyclopedia"
- },
- "searchUrl": {
- "message": "https://ko.wikipedia.org/wiki/특수기능:찾기"
- },
- "searchForm": {
- "message": "https://ko.wikipedia.org/wiki/특수기능:찾기?search={searchTerms}&sourceid=Mozilla…"
- },
- "suggestUrl": {
- "message": "https://ko.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/lij/messages.json b/browser/components/search/extensions/wikipedia/_locales/lij/messages.json
deleted file mode 100644
index cb90db5e4099..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/lij/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedia (lij)"
- },
- "extensionDescription": {
- "message": "Wikipedia, l'enciclopedia libera"
- },
- "searchUrl": {
- "message": "https://lij.wikipedia.org/wiki/Speçiale:Riçerca"
- },
- "searchForm": {
- "message": "https://lij.wikipedia.org/wiki/Speçiale:Riçerca?search={searchTerms}&source…"
- },
- "suggestUrl": {
- "message": "https://lij.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/lo/messages.json b/browser/components/search/extensions/wikipedia/_locales/lo/messages.json
deleted file mode 100644
index 712746ec6316..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/lo/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "ວິກິພີເດຍ (lo)"
- },
- "extensionDescription": {
- "message": "ວິກິພີເດຍ, ສາລານຸກົມເສລີ"
- },
- "searchUrl": {
- "message": "https://lo.wikipedia.org/wiki/ພິເສດ:ຊອກຫາ"
- },
- "searchForm": {
- "message": "https://lo.wikipedia.org/wiki/ພິເສດ:ຊອກຫາ?search={searchTerms}&sourceid=Moz…"
- },
- "suggestUrl": {
- "message": "https://lo.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/lt/messages.json b/browser/components/search/extensions/wikipedia/_locales/lt/messages.json
deleted file mode 100644
index c061bcc5224c..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/lt/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedia (lt)"
- },
- "extensionDescription": {
- "message": "Vikipedija, laisvoji enciklopedija"
- },
- "searchUrl": {
- "message": "https://lt.wikipedia.org/wiki/Specialus:Paieška"
- },
- "searchForm": {
- "message": "https://lt.wikipedia.org/wiki/Specialus:Paieška?search={searchTerms}&source…"
- },
- "suggestUrl": {
- "message": "https://lt.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/ltg/messages.json b/browser/components/search/extensions/wikipedia/_locales/ltg/messages.json
deleted file mode 100644
index 0e02810ef3bf..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/ltg/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Vikipedeja (ltg)"
- },
- "extensionDescription": {
- "message": "Vikipēdija, breivuo eņciklopedeja"
- },
- "searchUrl": {
- "message": "https://ltg.wikipedia.org/wiki/Seviškuo:Search"
- },
- "searchForm": {
- "message": "https://ltg.wikipedia.org/wiki/Seviškuo:Search?search={searchTerms}&sourcei…"
- },
- "suggestUrl": {
- "message": "https://ltg.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/lv/messages.json b/browser/components/search/extensions/wikipedia/_locales/lv/messages.json
deleted file mode 100644
index f73814b8574f..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/lv/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Vikipēdija"
- },
- "extensionDescription": {
- "message": "Vikipēdija, brīvā enciklopēdija"
- },
- "searchUrl": {
- "message": "https://lv.wikipedia.org/wiki/Special:Search"
- },
- "searchForm": {
- "message": "https://lv.wikipedia.org/wiki/Special:Search?search={searchTerms}&sourceid=…"
- },
- "suggestUrl": {
- "message": "https://lv.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/mk/messages.json b/browser/components/search/extensions/wikipedia/_locales/mk/messages.json
deleted file mode 100644
index de7e06e1ac4a..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/mk/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Википедија (mk)"
- },
- "extensionDescription": {
- "message": "Википедија, слободната енциклопедија"
- },
- "searchUrl": {
- "message": "https://mk.wikipedia.org/wiki/Специјална:Барај"
- },
- "searchForm": {
- "message": "https://mk.wikipedia.org/wiki/Специјална:Барај?search={searchTerms}&sourcei…"
- },
- "suggestUrl": {
- "message": "https://mk.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/mr/messages.json b/browser/components/search/extensions/wikipedia/_locales/mr/messages.json
deleted file mode 100644
index bd46dd83700c..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/mr/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "विकिपीडिया (mr)"
- },
- "extensionDescription": {
- "message": "विकिपीडिया, मोफत माहितीकोष"
- },
- "searchUrl": {
- "message": "https://mr.wikipedia.org/wiki/विशेष:शोधा"
- },
- "searchForm": {
- "message": "https://mr.wikipedia.org/wiki/विशेष:शोधा?search={searchTerms}&sourceid=Mozi…"
- },
- "suggestUrl": {
- "message": "https://mr.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/ms/messages.json b/browser/components/search/extensions/wikipedia/_locales/ms/messages.json
deleted file mode 100644
index c817e82c7821..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/ms/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedia (ms)"
- },
- "extensionDescription": {
- "message": "Wikipedia, ensiklopedia bebas"
- },
- "searchUrl": {
- "message": "https://ms.wikipedia.org/wiki/Khas:Gelintar"
- },
- "searchForm": {
- "message": "https://ms.wikipedia.org/wiki/Khas:Gelintar?search={searchTerms}&sourceid=M…"
- },
- "suggestUrl": {
- "message": "https://ms.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/my/messages.json b/browser/components/search/extensions/wikipedia/_locales/my/messages.json
deleted file mode 100644
index 62342d1b90ae..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/my/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedia (my)"
- },
- "extensionDescription": {
- "message": "အခမဲ့လွတ်လပ်စွယ်စုံကျမ်း"
- },
- "searchUrl": {
- "message": "https://my.wikipedia.org/wiki/Special:Search"
- },
- "searchForm": {
- "message": "https://my.wikipedia.org/wiki/Special:Search?search={searchTerms}&sourceid=…"
- },
- "suggestUrl": {
- "message": "https://my.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/ne/messages.json b/browser/components/search/extensions/wikipedia/_locales/ne/messages.json
deleted file mode 100644
index eb22344341e4..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/ne/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "विकिपीडिया (ne)"
- },
- "extensionDescription": {
- "message": "विकिपिडिया एक स्वतन्त्र विश्वकोष"
- },
- "searchUrl": {
- "message": "https://ne.wikipedia.org/wiki/विशेष:Search"
- },
- "searchForm": {
- "message": "https://ne.wikipedia.org/wiki/विशेष:Search?search={searchTerms}&sourceid=Mo…"
- },
- "suggestUrl": {
- "message": "https://ne.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/nl/messages.json b/browser/components/search/extensions/wikipedia/_locales/nl/messages.json
deleted file mode 100644
index c2a810c2ae30..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/nl/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedia (nl)"
- },
- "extensionDescription": {
- "message": "De vrije encyclopedie"
- },
- "searchUrl": {
- "message": "https://nl.wikipedia.org/wiki/Speciaal:Zoeken"
- },
- "searchForm": {
- "message": "https://nl.wikipedia.org/wiki/Speciaal:Zoeken?search={searchTerms}&sourceid…"
- },
- "suggestUrl": {
- "message": "https://nl.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/oc/messages.json b/browser/components/search/extensions/wikipedia/_locales/oc/messages.json
deleted file mode 100644
index 3cadc3d68f07..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/oc/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipèdia (oc)"
- },
- "extensionDescription": {
- "message": "Wikipèdia, l'enciclopèdia liura"
- },
- "searchUrl": {
- "message": "https://oc.wikipedia.org/wiki/Especial:Recèrca"
- },
- "searchForm": {
- "message": "https://oc.wikipedia.org/wiki/Especial:Recèrca?search={searchTerms}&sourcei…"
- },
- "suggestUrl": {
- "message": "https://oc.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/pa/messages.json b/browser/components/search/extensions/wikipedia/_locales/pa/messages.json
deleted file mode 100644
index dff38c2146fd..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/pa/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedia (pa)"
- },
- "extensionDescription": {
- "message": "ਵਿਕਿਪੀਡਿਆ, ਮੁਫ਼ਤ/ਮੁਕਤ ਸ਼ਬਦਕੋਸ਼"
- },
- "searchUrl": {
- "message": "https://pa.wikipedia.org/wiki/ਖ਼ਾਸ:ਖੋਜੋ"
- },
- "searchForm": {
- "message": "https://pa.wikipedia.org/wiki/ਖ਼ਾਸ:ਖੋਜੋ?search={searchTerms}&sourceid=Mozil…"
- },
- "suggestUrl": {
- "message": "https://pa.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/pl/messages.json b/browser/components/search/extensions/wikipedia/_locales/pl/messages.json
deleted file mode 100644
index 315aa0d9cbe1..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/pl/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedia (pl)"
- },
- "extensionDescription": {
- "message": "Wikipedia, wolna encyklopedia"
- },
- "searchUrl": {
- "message": "https://pl.wikipedia.org/wiki/Specjalna:Szukaj"
- },
- "searchForm": {
- "message": "https://pl.wikipedia.org/wiki/Specjalna:Szukaj?search={searchTerms}&sourcei…"
- },
- "suggestUrl": {
- "message": "https://pl.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/pt/messages.json b/browser/components/search/extensions/wikipedia/_locales/pt/messages.json
deleted file mode 100644
index 4beaa97acc88..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/pt/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedia (pt)"
- },
- "extensionDescription": {
- "message": "Wikipédia, a enciclopédia livre"
- },
- "searchUrl": {
- "message": "https://pt.wikipedia.org/wiki/Especial:Pesquisar"
- },
- "searchForm": {
- "message": "https://pt.wikipedia.org/wiki/Especial:Pesquisar?search={searchTerms}&sourc…"
- },
- "suggestUrl": {
- "message": "https://pt.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/rm/messages.json b/browser/components/search/extensions/wikipedia/_locales/rm/messages.json
deleted file mode 100644
index 8258d5e43451..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/rm/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedia (rm)"
- },
- "extensionDescription": {
- "message": "Vichipedia, l'enciclopedia libra"
- },
- "searchUrl": {
- "message": "https://rm.wikipedia.org/wiki/Spezial:Search"
- },
- "searchForm": {
- "message": "https://rm.wikipedia.org/wiki/Spezial:Search?search={searchTerms}&sourceid=…"
- },
- "suggestUrl": {
- "message": "https://rm.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/ro/messages.json b/browser/components/search/extensions/wikipedia/_locales/ro/messages.json
deleted file mode 100644
index 48865fd547e4..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/ro/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedia (ro)"
- },
- "extensionDescription": {
- "message": "Wikipedia, enciclopedia liberă"
- },
- "searchUrl": {
- "message": "https://ro.wikipedia.org/wiki/Special:Căutare"
- },
- "searchForm": {
- "message": "https://ro.wikipedia.org/wiki/Special:Căutare?search={searchTerms}&sourceid…"
- },
- "suggestUrl": {
- "message": "https://ro.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/ru/messages.json b/browser/components/search/extensions/wikipedia/_locales/ru/messages.json
deleted file mode 100644
index 569467691d7c..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/ru/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Википедия (ru)"
- },
- "extensionDescription": {
- "message": "Википедия, свободная энциклопедия"
- },
- "searchUrl": {
- "message": "https://ru.wikipedia.org/wiki/Служебная:Поиск"
- },
- "searchForm": {
- "message": "https://ru.wikipedia.org/wiki/Служебная:Поиск?search={searchTerms}&sourceid…"
- },
- "suggestUrl": {
- "message": "https://ru.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/si/messages.json b/browser/components/search/extensions/wikipedia/_locales/si/messages.json
deleted file mode 100644
index 0406ae728d71..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/si/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedia (si)"
- },
- "extensionDescription": {
- "message": "Wikipedia, the free encyclopedia"
- },
- "searchUrl": {
- "message": "https://si.wikipedia.org/wiki/විශේෂ:ගවේෂණය"
- },
- "searchForm": {
- "message": "https://si.wikipedia.org/wiki/විශේෂ:ගවේෂණය?search={searchTerms}&sourceid=Mo…"
- },
- "suggestUrl": {
- "message": "https://si.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/sk/messages.json b/browser/components/search/extensions/wikipedia/_locales/sk/messages.json
deleted file mode 100644
index 5c2f75f8b031..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/sk/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipédia (sk)"
- },
- "extensionDescription": {
- "message": "Wikipédia, slobodná a otvorená encyklopédia"
- },
- "searchUrl": {
- "message": "https://sk.wikipedia.org/wiki/Špeciálne:Hľadanie"
- },
- "searchForm": {
- "message": "https://sk.wikipedia.org/wiki/Špeciálne:Hľadanie?search={searchTerms}&sourc…"
- },
- "suggestUrl": {
- "message": "https://sk.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/sl/messages.json b/browser/components/search/extensions/wikipedia/_locales/sl/messages.json
deleted file mode 100644
index 7385a2203474..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/sl/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedija (sl)"
- },
- "extensionDescription": {
- "message": "Wikipedija, prosta enciklopedija"
- },
- "searchUrl": {
- "message": "https://sl.wikipedia.org/wiki/Posebno:Iskanje"
- },
- "searchForm": {
- "message": "https://sl.wikipedia.org/wiki/Posebno:Iskanje?search={searchTerms}&sourceid…"
- },
- "suggestUrl": {
- "message": "https://sl.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/sq/messages.json b/browser/components/search/extensions/wikipedia/_locales/sq/messages.json
deleted file mode 100644
index 68361d8ab294..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/sq/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedia (sq)"
- },
- "extensionDescription": {
- "message": "Wikipedia, enciklopedia e lirë"
- },
- "searchUrl": {
- "message": "https://sq.wikipedia.org/wiki/Speciale:Kërkim"
- },
- "searchForm": {
- "message": "https://sq.wikipedia.org/wiki/Speciale:Kërkim?search={searchTerms}&sourceid…"
- },
- "suggestUrl": {
- "message": "https://sq.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/sr/messages.json b/browser/components/search/extensions/wikipedia/_locales/sr/messages.json
deleted file mode 100644
index 50ebc0a197a1..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/sr/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Википедија (sr)"
- },
- "extensionDescription": {
- "message": "Претрага Википедије на српском језику"
- },
- "searchUrl": {
- "message": "https://sr.wikipedia.org/wiki/Посебно:Претражи"
- },
- "searchForm": {
- "message": "https://sr.wikipedia.org/wiki/Посебно:Претражи?search={searchTerms}&sourcei…"
- },
- "suggestUrl": {
- "message": "https://sr.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/sv-SE/messages.json b/browser/components/search/extensions/wikipedia/_locales/sv-SE/messages.json
deleted file mode 100644
index 1edc3db80d98..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/sv-SE/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedia (sv)"
- },
- "extensionDescription": {
- "message": "Wikipedia, den fria encyklopedin"
- },
- "searchUrl": {
- "message": "https://sv.wikipedia.org/wiki/Special:Sök"
- },
- "searchForm": {
- "message": "https://sv.wikipedia.org/wiki/Special:Sök?search={searchTerms}&sourceid=Moz…"
- },
- "suggestUrl": {
- "message": "https://sv.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/ta/messages.json b/browser/components/search/extensions/wikipedia/_locales/ta/messages.json
deleted file mode 100644
index 54397603b028..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/ta/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "விக்கிப்பீடியா (ta)"
- },
- "extensionDescription": {
- "message": "விக்கிப்பீடியா (ta)"
- },
- "searchUrl": {
- "message": "https://ta.wikipedia.org/wiki/சிறப்பு:Search"
- },
- "searchForm": {
- "message": "https://ta.wikipedia.org/wiki/சிறப்பு:Search?search={searchTerms}&sourceid=…"
- },
- "suggestUrl": {
- "message": "https://ta.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/te/messages.json b/browser/components/search/extensions/wikipedia/_locales/te/messages.json
deleted file mode 100644
index c474be12a76f..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/te/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "వికీపీడియా (te)"
- },
- "extensionDescription": {
- "message": "వికీపీడియా (te)"
- },
- "searchUrl": {
- "message": "https://te.wikipedia.org/wiki/ప్రత్యేక:అన్వేషణ"
- },
- "searchForm": {
- "message": "https://te.wikipedia.org/wiki/ప్రత్యేక:అన్వేషణ?search={searchTerms}&sourcei…"
- },
- "suggestUrl": {
- "message": "https://te.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/th/messages.json b/browser/components/search/extensions/wikipedia/_locales/th/messages.json
deleted file mode 100644
index 3d6aeb07ca2c..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/th/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "วิกิพีเดีย"
- },
- "extensionDescription": {
- "message": "วิกิพีเดีย สารานุกรมเสรี"
- },
- "searchUrl": {
- "message": "https://th.wikipedia.org/wiki/พิเศษ:ค้นหา"
- },
- "searchForm": {
- "message": "https://th.wikipedia.org/wiki/พิเศษ:ค้นหา?search={searchTerms}&sourceid=Moz…"
- },
- "suggestUrl": {
- "message": "https://th.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/tl/messages.json b/browser/components/search/extensions/wikipedia/_locales/tl/messages.json
deleted file mode 100644
index d55b03131f97..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/tl/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedia (tl)"
- },
- "extensionDescription": {
- "message": "Wikipedia, ang malayang ensiklopedya"
- },
- "searchUrl": {
- "message": "https://tl.wikipedia.org/wiki/Natatangi:Maghanap"
- },
- "searchForm": {
- "message": "https://tl.wikipedia.org/wiki/Natatangi:Maghanap?search={searchTerms}&sourc…"
- },
- "suggestUrl": {
- "message": "https://tl.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/tr/messages.json b/browser/components/search/extensions/wikipedia/_locales/tr/messages.json
deleted file mode 100644
index 878b28ab68b2..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/tr/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedia (tr)"
- },
- "extensionDescription": {
- "message": "Vikipedi, özgür ansiklopedi"
- },
- "searchUrl": {
- "message": "https://tr.wikipedia.org/wiki/Özel:Ara"
- },
- "searchForm": {
- "message": "https://tr.wikipedia.org/wiki/Özel:Ara?search={searchTerms}&sourceid=Mozill…"
- },
- "suggestUrl": {
- "message": "https://tr.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/uk/messages.json b/browser/components/search/extensions/wikipedia/_locales/uk/messages.json
deleted file mode 100644
index 2749b86304bf..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/uk/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Вікіпедія (uk)"
- },
- "extensionDescription": {
- "message": "Вікіпедія, вільна енциклопедія"
- },
- "searchUrl": {
- "message": "https://uk.wikipedia.org/wiki/Спеціальна:Пошук"
- },
- "searchForm": {
- "message": "https://uk.wikipedia.org/wiki/Спеціальна:Пошук?search={searchTerms}&sourcei…"
- },
- "suggestUrl": {
- "message": "https://uk.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/ur/messages.json b/browser/components/search/extensions/wikipedia/_locales/ur/messages.json
deleted file mode 100644
index dcc87e0c853c..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/ur/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "ویکیپیڈیا (ur)"
- },
- "extensionDescription": {
- "message": "ویکیپیڈیا آزاد دائرۃ المعارف"
- },
- "searchUrl": {
- "message": "https://ur.wikipedia.org/wiki/خاص:تلاش"
- },
- "searchForm": {
- "message": "https://ur.wikipedia.org/wiki/خاص:تلاش?search={searchTerms}&sourceid=Mozill…"
- },
- "suggestUrl": {
- "message": "https://ur.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/uz/messages.json b/browser/components/search/extensions/wikipedia/_locales/uz/messages.json
deleted file mode 100644
index 89a8f2a89bca..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/uz/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Vikipediya (uz)"
- },
- "extensionDescription": {
- "message": "Vikipediya, ochiq ensiklopediya"
- },
- "searchUrl": {
- "message": "https://uz.wikipedia.org/wiki/Maxsus:Search"
- },
- "searchForm": {
- "message": "https://uz.wikipedia.org/wiki/Maxsus:Search?search={searchTerms}&sourceid=M…"
- },
- "suggestUrl": {
- "message": "https://uz.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/vi/messages.json b/browser/components/search/extensions/wikipedia/_locales/vi/messages.json
deleted file mode 100644
index c0844e4feb14..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/vi/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedia (vi)"
- },
- "extensionDescription": {
- "message": "Wikipedia, bách khoa toàn thư mở"
- },
- "searchUrl": {
- "message": "https://vi.wikipedia.org/wiki/Đặc_biệt:Tìm_kiếm"
- },
- "searchForm": {
- "message": "https://vi.wikipedia.org/wiki/Đặc_biệt:Tìm_kiếm?search={searchTerms}&source…"
- },
- "suggestUrl": {
- "message": "https://vi.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/wo/messages.json b/browser/components/search/extensions/wikipedia/_locales/wo/messages.json
deleted file mode 100644
index 7efde3b1d0f4..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/wo/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedia (wo)"
- },
- "extensionDescription": {
- "message": "Wikipedia, Jimbulang bu Ubbeeku bi"
- },
- "searchUrl": {
- "message": "https://wo.wikipedia.org/wiki/Jagleel:Ceet"
- },
- "searchForm": {
- "message": "https://wo.wikipedia.org/wiki/Jagleel:Ceet?search={searchTerms}&sourceid=Mo…"
- },
- "suggestUrl": {
- "message": "https://wo.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/zh-CN/messages.json b/browser/components/search/extensions/wikipedia/_locales/zh-CN/messages.json
deleted file mode 100644
index 29047565a243..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/zh-CN/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "维基百科"
- },
- "extensionDescription": {
- "message": "维基百科,自由的百科全书"
- },
- "searchUrl": {
- "message": "https://zh.wikipedia.org/wiki/Special:搜索"
- },
- "searchForm": {
- "message": "https://zh.wikipedia.org/wiki/Special:搜索?search={searchTerms}&sourceid=Mozi…"
- },
- "suggestUrl": {
- "message": "https://zh.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/_locales/zh-TW/messages.json b/browser/components/search/extensions/wikipedia/_locales/zh-TW/messages.json
deleted file mode 100644
index a0e8d880ea26..000000000000
--- a/browser/components/search/extensions/wikipedia/_locales/zh-TW/messages.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensionName": {
- "message": "Wikipedia (zh)"
- },
- "extensionDescription": {
- "message": "維基百科,自由的百科全書"
- },
- "searchUrl": {
- "message": "https://zh.wikipedia.org/wiki/Special:搜索"
- },
- "searchForm": {
- "message": "https://zh.wikipedia.org/wiki/Special:搜索?search={searchTerms}&sourceid=Mozi…"
- },
- "suggestUrl": {
- "message": "https://zh.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}"
- },
- "searchUrlGetParams": {
- "message": "search={searchTerms}&sourceid=Mozilla-search&variant=zh-tw"
- }
-}
\ No newline at end of file
diff --git a/browser/components/search/extensions/wikipedia/manifest.json b/browser/components/search/extensions/wikipedia/manifest.json
index cd95d3aa9e1c..0af3b2a1c211 100644
--- a/browser/components/search/extensions/wikipedia/manifest.json
+++ b/browser/components/search/extensions/wikipedia/manifest.json
@@ -1,6 +1,6 @@
{
- "name": "__MSG_extensionName__",
- "description": "__MSG_extensionDescription__",
+ "name": "Wikipedia (en)",
+ "description": "Wikipedia, the Free Encyclopedia",
"manifest_version": 2,
"version": "1.1",
"applications": {
@@ -9,7 +9,6 @@
}
},
"hidden": true,
- "default_locale": "en",
"icons": {
"16": "favicon.ico"
},
@@ -19,11 +18,11 @@
"chrome_settings_overrides": {
"search_provider": {
"keyword": "@wikipedia",
- "name": "__MSG_extensionName__",
- "search_url": "__MSG_searchUrl__",
- "search_form": "__MSG_searchForm__",
- "suggest_url": "__MSG_suggestUrl__",
- "search_url_get_params": "__MSG_searchUrlGetParams__"
+ "name": "Wikipedia (en)",
+ "search_url": "https://en.wikipedia.org/wiki/Special:Search",
+ "search_form": "https://en.wikipedia.org/wiki/Special:Search?search={searchTerms}&sourceid=…",
+ "suggest_url": "https://en.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}",
+ "search_url_get_params": "search={searchTerms}&sourceid=Mozilla-search"
}
}
}
diff --git a/browser/components/search/extensions/yahoo/favicon.ico b/browser/components/search/extensions/yahoo/favicon.ico
new file mode 100644
index 000000000000..9bd1d9f7c008
Binary files /dev/null and b/browser/components/search/extensions/yahoo/favicon.ico differ
diff --git a/browser/components/search/extensions/yahoo/manifest.json b/browser/components/search/extensions/yahoo/manifest.json
new file mode 100644
index 000000000000..e1f04a373c2e
--- /dev/null
+++ b/browser/components/search/extensions/yahoo/manifest.json
@@ -0,0 +1,28 @@
+{
+ "name": "Yahoo",
+ "description": "Yahoo Search",
+ "manifest_version": 2,
+ "version": "1.0",
+ "applications": {
+ "gecko": {
+ "id": "yahoo(a)search.mozilla.org"
+ }
+ },
+ "hidden": true,
+ "icons": {
+ "16": "favicon.ico"
+ },
+ "web_accessible_resources": [
+ "favicon.ico"
+ ],
+ "chrome_settings_overrides": {
+ "search_provider": {
+ "name": "Yahoo",
+ "search_url": "https://search.yahoo.com/yhs/search",
+ "search_form": "https://search.yahoo.com/yhs/search?p={searchTerms}&ei=UTF-8&hspart=mozilla",
+ "search_url_get_params": "p={searchTerms}&ei=UTF-8&hspart=mozilla",
+ "suggest_url": "https://search.yahoo.com/sugg/ff",
+ "suggest_url_get_params": "output=fxjson&appid=ffd&command={searchTerms}"
+ }
+ }
+}
diff --git a/browser/components/search/extensions/youtube/favicon.ico b/browser/components/search/extensions/youtube/favicon.ico
new file mode 100644
index 000000000000..977887dbbb84
Binary files /dev/null and b/browser/components/search/extensions/youtube/favicon.ico differ
diff --git a/browser/components/search/extensions/youtube/manifest.json b/browser/components/search/extensions/youtube/manifest.json
new file mode 100644
index 000000000000..6fbf8745bac2
--- /dev/null
+++ b/browser/components/search/extensions/youtube/manifest.json
@@ -0,0 +1,26 @@
+{
+ "name": "YouTube",
+ "description": "YouTube - Videos",
+ "manifest_version": 2,
+ "version": "1.0",
+ "applications": {
+ "gecko": {
+ "id": "youtube(a)search.mozilla.org"
+ }
+ },
+ "hidden": true,
+ "icons": {
+ "16": "favicon.ico"
+ },
+ "web_accessible_resources": [
+ "favicon.ico"
+ ],
+ "chrome_settings_overrides": {
+ "search_provider": {
+ "name": "YouTube",
+ "search_url": "https://www.youtube.com/results?search_query={searchTerms}&search=Search",
+ "search_form": "https://www.youtube.com/index",
+ "suggest_url": "https://suggestqueries.google.com/complete/search?output=firefox&ds=yt&q={s…"
+ }
+ }
+}
\ No newline at end of file
diff --git a/tbb-tests/browser_tor_omnibox.js b/tbb-tests/browser_tor_omnibox.js
new file mode 100644
index 000000000000..f3efd0c3da5e
--- /dev/null
+++ b/tbb-tests/browser_tor_omnibox.js
@@ -0,0 +1,14 @@
+// # Test Tor Omnibox
+// Check what search engines are installed in the search box.
+
+add_task(async function() {
+ // Grab engine IDs.
+ let browserSearchService = Components.classes["@mozilla.org/browser/search-service;1"]
+ .getService(Components.interfaces.nsISearchService),
+ engineIDs = (await browserSearchService.getEngines()).map(e => e.identifier);
+
+ // Check that we have the correct engines installed, in the right order.
+ is(engineIDs[0], "ddg", "Default search engine is duckduckgo");
+ is(engineIDs[1], "youtube", "Secondary search engine is youtube");
+ is(engineIDs[2], "google", "Google is third search engine");
+});
diff --git a/toolkit/components/search/SearchService.jsm b/toolkit/components/search/SearchService.jsm
index 193c5d3d20cc..7ccb95fc575d 100644
--- a/toolkit/components/search/SearchService.jsm
+++ b/toolkit/components/search/SearchService.jsm
@@ -20,7 +20,6 @@ XPCOMUtils.defineLazyModuleGetters(this, {
Region: "resource://gre/modules/Region.jsm",
RemoteSettings: "resource://services-settings/remote-settings.js",
SearchEngine: "resource://gre/modules/SearchEngine.jsm",
- SearchEngineSelector: "resource://gre/modules/SearchEngineSelector.jsm",
SearchSettings: "resource://gre/modules/SearchSettings.jsm",
SearchStaticData: "resource://gre/modules/SearchStaticData.jsm",
SearchUtils: "resource://gre/modules/SearchUtils.jsm",
@@ -269,11 +268,6 @@ SearchService.prototype = {
Services.obs.addObserver(this, Region.REGION_TOPIC);
try {
- // Create the search engine selector.
- this._engineSelector = new SearchEngineSelector(
- this._handleConfigurationUpdated.bind(this)
- );
-
// See if we have a settings file so we don't have to parse a bunch of XML.
let settings = await this._settings.get();
@@ -1078,16 +1072,16 @@ SearchService.prototype = {
? "esr"
: AppConstants.MOZ_UPDATE_CHANNEL;
- let {
- engines,
- privateDefault,
- } = await this._engineSelector.fetchEngineConfiguration({
- locale,
- region,
- channel,
- experiment: gExperiment,
- distroID: SearchUtils.distroID,
- });
+ const engines = [
+ { webExtension: { id: "ddg(a)search.mozilla.org" }, orderHint: 100 },
+ { webExtension: { id: "youtube(a)search.mozilla.org" }, orderHint: 90 },
+ { webExtension: { id: "google(a)search.mozilla.org" }, orderHint: 80 },
+ { webExtension: { id: "ddg-onion(a)search.mozilla.org" }, orderHint: 70 },
+ { webExtension: { id: "startpage(a)search.mozilla.org" }, orderHint: 60 },
+ { webExtension: { id: "twitter(a)search.mozilla.org" }, orderHint: 50 },
+ { webExtension: { id: "wikipedia(a)search.mozilla.org" }, orderHint: 40 },
+ { webExtension: { id: "yahoo(a)search.mozilla.org" }, orderHint: 30 },
+ ];
for (let e of engines) {
if (!e.webExtension) {
@@ -1096,7 +1090,7 @@ SearchService.prototype = {
e.webExtension.locale = e.webExtension?.locale ?? SearchUtils.DEFAULT_TAG;
}
- return { engines, privateDefault };
+ return { engines, privateDefault: undefined };
},
_setDefaultAndOrdersFromSelector(engines, privateDefault) {
1
0

[tor-browser/tor-browser-88.0.1-10.0-1] Bug 4234: Use the Firefox Update Process for Tor Browser.
by sysrqb@torproject.org 04 May '21
by sysrqb@torproject.org 04 May '21
04 May '21
commit 99e240152e2835f4e9c711f7ce8a029aa7e2b11f
Author: Kathy Brade <brade(a)pearlcrescent.com>
Date: Fri Jan 13 11:40:24 2017 -0500
Bug 4234: Use the Firefox Update Process for Tor Browser.
The following files are never updated:
TorBrowser/Data/Browser/profiles.ini
TorBrowser/Data/Browser/profile.default/bookmarks.html
TorBrowser/Data/Tor/torrc
Mac OS: Store update metadata under TorBrowser/UpdateInfo.
Removed the %OS_VERSION% component from the update URL (13047) and
added support for minSupportedOSVersion, an attribute of the
<update> element that may be used to trigger Firefox's
"unsupported platform" behavior.
Hide the "What's new" links (set app.releaseNotesURL value to about:blank).
Windows: disable "runas" code path in updater (15201).
Windows: avoid writing to the registry (16236).
Also includes fixes for tickets 13047, 13301, 13356, 13594, 15406,
16014, 16909, 24476, and 25909.
Also fix Bug 26049: reduce the delay before the update prompt is displayed.
Instead of Firefox's 2 days, we use 1 hour (after which time the update
doorhanger will be displayed).
Also fix bug 27221: purge the startup cache if the Tor Browser
version changed (even if the Firefox version and build ID did
not change), e.g., after a minor Tor Browser update.
Also fix 32616: Disable GetSecureOutputDirectoryPath() functionality.
Bug 26048: potentially confusing "restart to update" message
Within the update doorhanger, remove the misleading message that mentions
that windows will be restored after an update is applied, and replace the
"Restart and Restore" button label with an existing
"Restart to update Tor Browser" string.
Bug 28885: notify users that update is downloading
Add a "Downloading Tor Browser update" item which appears in the
hamburger (app) menu while the update service is downloading a MAR
file. Before this change, the browser did not indicate to the user
that an update was in progress, which is especially confusing in
Tor Browser because downloads often take some time. If the user
clicks on the new menu item, the about dialog is opened to allow
the user to see download progress.
As part of this fix, the update service was changed to always show
update-related messages in the hamburger menu, even if the update
was started in the foreground via the about dialog or via the
"Check for Tor Browser Update" toolbar menu item. This change is
consistent with the Tor Browser goal of making sure users are
informed about the update process.
Removed #28885 parts of this patch which have been uplifted to Firefox.
---
browser/app/Makefile.in | 2 +
browser/app/profile/000-tor-browser.js | 16 +-
browser/app/profile/firefox.js | 10 +-
browser/base/content/aboutDialog-appUpdater.js | 2 +-
browser/base/content/aboutDialog.js | 12 +-
browser/components/BrowserContentHandler.jsm | 39 ++-
.../customizableui/content/panelUI.inc.xhtml | 5 +-
browser/confvars.sh | 35 +--
browser/installer/package-manifest.in | 2 +
build/application.ini.in | 2 +-
build/moz.configure/init.configure | 3 +-
config/createprecomplete.py | 19 +-
.../client/aboutdebugging/src/actions/runtimes.js | 5 +
toolkit/modules/UpdateUtils.jsm | 22 +-
toolkit/mozapps/extensions/AddonManager.jsm | 24 ++
toolkit/mozapps/extensions/test/browser/head.js | 1 +
.../extensions/test/xpcshell/head_addons.js | 1 +
toolkit/mozapps/update/UpdateService.jsm | 125 +++++++-
toolkit/mozapps/update/UpdateServiceStub.jsm | 4 +
toolkit/mozapps/update/common/updatehelper.cpp | 8 +
toolkit/mozapps/update/moz.build | 5 +-
toolkit/mozapps/update/updater/launchchild_osx.mm | 2 +
toolkit/mozapps/update/updater/moz.build | 2 +-
toolkit/mozapps/update/updater/updater.cpp | 339 ++++++++++++++++++---
toolkit/xre/MacLaunchHelper.h | 2 +
toolkit/xre/MacLaunchHelper.mm | 2 +
toolkit/xre/nsAppRunner.cpp | 22 +-
toolkit/xre/nsUpdateDriver.cpp | 109 ++++++-
toolkit/xre/nsXREDirProvider.cpp | 42 ++-
tools/update-packaging/common.sh | 64 ++--
tools/update-packaging/make_full_update.sh | 25 ++
tools/update-packaging/make_incremental_update.sh | 71 ++++-
32 files changed, 877 insertions(+), 145 deletions(-)
diff --git a/browser/app/Makefile.in b/browser/app/Makefile.in
index 8dd3a9a65661..3a5550c96c15 100644
--- a/browser/app/Makefile.in
+++ b/browser/app/Makefile.in
@@ -97,10 +97,12 @@ tools repackage:: $(DIST)/bin/$(MOZ_APP_NAME) $(objdir)/macbuild/Contents/MacOS-
rsync -aL $(DIST)/bin/$(MOZ_APP_NAME) '$(dist_dest)/Contents/MacOS'
cp -RL $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/firefox.icns '$(dist_dest)/Contents/Resources/firefox.icns'
cp -RL $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/document.icns '$(dist_dest)/Contents/Resources/document.icns'
+ifndef TOR_BROWSER_UPDATE
$(MKDIR) -p '$(dist_dest)/Contents/Library/LaunchServices'
ifdef MOZ_UPDATER
mv -f '$(dist_dest)/Contents/MacOS/updater.app/Contents/MacOS/org.mozilla.updater' '$(dist_dest)/Contents/Library/LaunchServices'
ln -s ../../../../Library/LaunchServices/org.mozilla.updater '$(dist_dest)/Contents/MacOS/updater.app/Contents/MacOS/org.mozilla.updater'
+endif
endif
printf APPLTORB > '$(dist_dest)/Contents/PkgInfo'
endif
diff --git a/browser/app/profile/000-tor-browser.js b/browser/app/profile/000-tor-browser.js
index 0ae4d896ee7c..68caacc88b82 100644
--- a/browser/app/profile/000-tor-browser.js
+++ b/browser/app/profile/000-tor-browser.js
@@ -7,7 +7,6 @@
// Disable initial homepage notifications
pref("browser.search.update", false);
pref("browser.rights.3.shown", true);
-pref("browser.startup.homepage_override.mstone", "ignore");
pref("startup.homepage_welcome_url", "");
pref("startup.homepage_welcome_url.additional", "");
@@ -20,9 +19,17 @@ pref("startup.homepage_override_url", "https://blog.torproject.org/category/tags
// Try to nag a bit more about updates: Pop up a restart dialog an hour after the initial dialog
pref("app.update.promptWaitTime", 3600);
-
-#ifdef XP_WIN
-// For now, disable staged updates on Windows (see #18292).
+pref("app.update.notifyDuringDownload", true);
+pref("app.update.url.manual", "https://www.torproject.org/download/languages/");
+pref("app.update.url.details", "https://www.torproject.org/download/");
+pref("app.update.badgeWaitTime", 0);
+pref("app.releaseNotesURL", "about:blank");
+
+#ifndef XP_MACOSX
+// Disable staged updates on platforms other than macOS.
+// Staged updates do not work on Windows due to #18292.
+// Also, on Windows and Linux any changes that are made to the browser profile
+// or Tor data after an update is staged will be lost.
pref("app.update.staging.enabled", false);
#endif
@@ -82,6 +89,7 @@ pref("datareporting.policy.dataSubmissionEnabled", false);
// Make sure Unified Telemetry is really disabled, see: #18738.
pref("toolkit.telemetry.unified", false);
pref("toolkit.telemetry.enabled", false);
+pref("toolkit.telemetry.updatePing.enabled", false); // Make sure updater telemetry is disabled; see #25909.
#ifdef XP_WIN
// Defense-in-depth: ensure that the Windows default browser agent will
// not ping Mozilla if it is somehow present (we omit it at build time).
diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js
index 92b0f91a4151..3c0fdc793a49 100644
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -134,14 +134,8 @@ pref("app.update.elevation.promptMaxAttempts", 2);
pref("app.update.notifyDuringDownload", false);
// If set to true, the Update Service will automatically download updates if the
-// user can apply updates. This pref is no longer used on Windows, except as the
-// default value to migrate to the new location that this data is now stored
-// (which is in a file in the update directory). Because of this, this pref
-// should no longer be used directly. Instead, getAppUpdateAutoEnabled and
-// getAppUpdateAutoEnabled from UpdateUtils.jsm should be used.
-#ifndef XP_WIN
- pref("app.update.auto", true);
-#endif
+// user can apply updates.
+pref("app.update.auto", true);
// If set to true, the Update Service will apply updates in the background
// when it finishes downloading them.
diff --git a/browser/base/content/aboutDialog-appUpdater.js b/browser/base/content/aboutDialog-appUpdater.js
index 6d7e9a5e5b7e..b5d5a5d38628 100644
--- a/browser/base/content/aboutDialog-appUpdater.js
+++ b/browser/base/content/aboutDialog-appUpdater.js
@@ -165,7 +165,7 @@ appUpdater.prototype = {
if (aChildID == "downloadAndInstall") {
let updateVersion = gAppUpdater.update.displayVersion;
// Include the build ID if this is an "a#" (nightly or aurora) build
- if (/a\d+$/.test(updateVersion)) {
+ if (!AppConstants.TOR_BROWSER_UPDATE && /a\d+$/.test(updateVersion)) {
let buildID = gAppUpdater.update.buildID;
let year = buildID.slice(0, 4);
let month = buildID.slice(4, 6);
diff --git a/browser/base/content/aboutDialog.js b/browser/base/content/aboutDialog.js
index b96337666cff..ab1d9b80b944 100644
--- a/browser/base/content/aboutDialog.js
+++ b/browser/base/content/aboutDialog.js
@@ -56,15 +56,13 @@ async function init(aEvent) {
bits: Services.appinfo.is64Bit ? 64 : 32,
};
+ // Adjust version text to show the Tor Browser version
+ versionAttributes.version = AppConstants.TOR_BROWSER_VERSION +
+ " (based on Mozilla Firefox " +
+ AppConstants.MOZ_APP_VERSION_DISPLAY + ")";
+
let version = Services.appinfo.version;
if (/a\d+$/.test(version)) {
- versionId = "aboutDialog-version-nightly";
- let buildID = Services.appinfo.appBuildID;
- let year = buildID.slice(0, 4);
- let month = buildID.slice(4, 6);
- let day = buildID.slice(6, 8);
- versionAttributes.isodate = `${year}-${month}-${day}`;
-
document.getElementById("experimental").hidden = false;
document.getElementById("communityDesc").hidden = true;
}
diff --git a/browser/components/BrowserContentHandler.jsm b/browser/components/BrowserContentHandler.jsm
index b4ea1974aa5b..0a37ca088ca0 100644
--- a/browser/components/BrowserContentHandler.jsm
+++ b/browser/components/BrowserContentHandler.jsm
@@ -46,6 +46,8 @@ XPCOMUtils.defineLazyGlobalGetters(this, [URL]);
const NEWINSTALL_PAGE = "about:newinstall";
+const kTBSavedVersionPref = "browser.startup.homepage_override.torbrowser.version";
+
// One-time startup homepage override configurations
const ONCE_DOMAINS = ["mozilla.org", "firefox.com"];
const ONCE_PREF = "browser.startup.homepage_override.once";
@@ -105,7 +107,8 @@ const OVERRIDE_ALTERNATE_PROFILE = 4;
* Returns:
* OVERRIDE_NEW_PROFILE if this is the first run with a new profile.
* OVERRIDE_NEW_MSTONE if this is the first run with a build with a different
- * Gecko milestone (i.e. right after an upgrade).
+ * Gecko milestone or Tor Browser version (i.e. right
+ * after an upgrade).
* OVERRIDE_NEW_BUILD_ID if this is the first run with a new build ID of the
* same Gecko milestone (i.e. after a nightly upgrade).
* OVERRIDE_NONE otherwise.
@@ -128,6 +131,11 @@ function needHomepageOverride(prefb) {
var mstone = Services.appinfo.platformVersion;
+ var savedTBVersion = null;
+ try {
+ savedTBVersion = prefb.getCharPref(kTBSavedVersionPref);
+ } catch (e) {}
+
var savedBuildID = prefb.getCharPref(
"browser.startup.homepage_override.buildID",
""
@@ -146,7 +154,22 @@ function needHomepageOverride(prefb) {
prefb.setCharPref("browser.startup.homepage_override.mstone", mstone);
prefb.setCharPref("browser.startup.homepage_override.buildID", buildID);
- return savedmstone ? OVERRIDE_NEW_MSTONE : OVERRIDE_NEW_PROFILE;
+ prefb.setCharPref(kTBSavedVersionPref, AppConstants.TOR_BROWSER_VERSION);
+
+ // After an upgrade from an older release of Tor Browser (<= 5.5a1), the
+ // savedmstone will be undefined because those releases included the
+ // value "ignore" for the browser.startup.homepage_override.mstone pref.
+ // To correctly detect an upgrade vs. a new profile, we check for the
+ // presence of the "app.update.postupdate" pref.
+ let updated = prefb.prefHasUserValue("app.update.postupdate");
+ return (savedmstone || updated) ? OVERRIDE_NEW_MSTONE
+ : OVERRIDE_NEW_PROFILE;
+ }
+
+ if (AppConstants.TOR_BROWSER_VERSION != savedTBVersion) {
+ prefb.setCharPref("browser.startup.homepage_override.buildID", buildID);
+ prefb.setCharPref(kTBSavedVersionPref, AppConstants.TOR_BROWSER_VERSION);
+ return OVERRIDE_NEW_MSTONE;
}
if (buildID != savedBuildID) {
@@ -647,6 +670,13 @@ nsBrowserContentHandler.prototype = {
"browser.startup.homepage_override.buildID",
"unknown"
);
+
+ // We do the same for the Tor Browser version.
+ let old_tbversion = null;
+ try {
+ old_tbversion = prefb.getCharPref(kTBSavedVersionPref);
+ } catch (e) {}
+
override = needHomepageOverride(prefb);
if (override != OVERRIDE_NONE) {
switch (override) {
@@ -679,9 +709,10 @@ nsBrowserContentHandler.prototype = {
"startup.homepage_override_url"
);
let update = UpdateManager.readyUpdate;
+ let old_version = old_tbversion ? old_tbversion: old_mstone;
if (
update &&
- Services.vc.compare(update.appVersion, old_mstone) > 0
+ Services.vc.compare(update.appVersion, old_version) > 0
) {
overridePage = getPostUpdateOverridePage(update, overridePage);
// Send the update ping to signal that the update was successful.
@@ -689,6 +720,8 @@ nsBrowserContentHandler.prototype = {
}
overridePage = overridePage.replace("%OLD_VERSION%", old_mstone);
+ overridePage = overridePage.replace("%OLD_TOR_BROWSER_VERSION%",
+ old_tbversion);
break;
case OVERRIDE_NEW_BUILD_ID:
if (UpdateManager.readyUpdate) {
diff --git a/browser/components/customizableui/content/panelUI.inc.xhtml b/browser/components/customizableui/content/panelUI.inc.xhtml
index de4c77954757..dfa3578027a2 100644
--- a/browser/components/customizableui/content/panelUI.inc.xhtml
+++ b/browser/components/customizableui/content/panelUI.inc.xhtml
@@ -144,14 +144,15 @@
<popupnotification id="appMenu-update-restart-notification"
popupid="update-restart"
data-lazy-l10n-id="appmenu-update-restart"
- data-l10n-attrs="buttonlabel, buttonaccesskey, secondarybuttonlabel, secondarybuttonaccesskey"
+ data-l10n-attrs="buttonaccesskey, secondarybuttonlabel, secondarybuttonaccesskey"
+ buttonlabel="&updateRestart.panelUI.label2;"
closebuttonhidden="true"
dropmarkerhidden="true"
checkboxhidden="true"
buttonhighlight="true"
hidden="true">
<popupnotificationcontent id="update-restart-notification-content" orient="vertical">
- <description id="update-restart-description" data-lazy-l10n-id="appmenu-update-restart-message"></description>
+ <description id="update-restart-description"> </description>
</popupnotificationcontent>
</popupnotification>
diff --git a/browser/confvars.sh b/browser/confvars.sh
index 92871c9516f9..040a27e9b92d 100755
--- a/browser/confvars.sh
+++ b/browser/confvars.sh
@@ -6,26 +6,6 @@
MOZ_APP_VENDOR=Mozilla
MOZ_UPDATER=1
-if test "$OS_ARCH" = "WINNT"; then
- if ! test "$HAVE_64BIT_BUILD"; then
- if test "$MOZ_UPDATE_CHANNEL" = "nightly" -o \
- "$MOZ_UPDATE_CHANNEL" = "nightly-try" -o \
- "$MOZ_UPDATE_CHANNEL" = "aurora" -o \
- "$MOZ_UPDATE_CHANNEL" = "beta" -o \
- "$MOZ_UPDATE_CHANNEL" = "release"; then
- if ! test "$MOZ_DEBUG"; then
- if ! test "$USE_STUB_INSTALLER"; then
- # Expect USE_STUB_INSTALLER from taskcluster for downstream task consistency
- echo "ERROR: STUB installer expected to be enabled but"
- echo "ERROR: USE_STUB_INSTALLER is not specified in the environment"
- exit 1
- fi
- MOZ_STUB_INSTALLER=1
- fi
- fi
- fi
-fi
-
BROWSER_CHROME_URL=chrome://browser/content/browser.xhtml
# MOZ_APP_DISPLAYNAME will be set by branding/configure.sh
@@ -38,6 +18,21 @@ MOZ_BRANDING_DIRECTORY=browser/branding/unofficial
MOZ_OFFICIAL_BRANDING_DIRECTORY=browser/branding/official
MOZ_APP_ID={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+# ACCEPTED_MAR_CHANNEL_IDS should usually be the same as the value MAR_CHANNEL_ID.
+# If more than one ID is needed, then you should use a comma separated list
+# of values.
+# The MAR_CHANNEL_ID must not contain the following 3 characters: ",\t "
+if test "$MOZ_UPDATE_CHANNEL" = "alpha"; then
+ ACCEPTED_MAR_CHANNEL_IDS=torbrowser-torproject-alpha
+ MAR_CHANNEL_ID=torbrowser-torproject-alpha
+elif test "$MOZ_UPDATE_CHANNEL" = "nightly"; then
+ ACCEPTED_MAR_CHANNEL_IDS=torbrowser-torproject-nightly
+ MAR_CHANNEL_ID=torbrowser-torproject-nightly
+else
+ ACCEPTED_MAR_CHANNEL_IDS=torbrowser-torproject-release
+ MAR_CHANNEL_ID=torbrowser-torproject-release
+fi
+
MOZ_PROFILE_MIGRATOR=1
# Include the DevTools client, not just the server (which is the default)
diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in
index 37b44b37d9ce..667da5835b9b 100644
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -36,8 +36,10 @@
; Mac bundle stuff
@APPNAME@/Contents/Info.plist
#ifdef MOZ_UPDATER
+#ifndef TOR_BROWSER_UPDATE
@APPNAME@/Contents/Library/LaunchServices
#endif
+#endif
@APPNAME@/Contents/PkgInfo
@RESPATH@/firefox.icns
@RESPATH@/document.icns
diff --git a/build/application.ini.in b/build/application.ini.in
index 6df13230a45b..9a0b162d447d 100644
--- a/build/application.ini.in
+++ b/build/application.ini.in
@@ -52,5 +52,5 @@ ServerURL=@MOZ_CRASHREPORTER_URL@/submit?id=@MOZ_APP_ID@&version=@MOZ_APP_VERSIO
#if MOZ_UPDATER
[AppUpdate]
-URL=https://@MOZ_APPUPDATE_HOST@/update/6/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%SYSTEM_CAPABILITIES%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/update.xml
+URL=https://aus1.torproject.org/torbrowser/update_3/%CHANNEL%/%BUILD_TARGET%/%VERSION%/%LOCALE%
#endif
diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.configure
index 7f5ff646f723..f4ede51250f9 100644
--- a/build/moz.configure/init.configure
+++ b/build/moz.configure/init.configure
@@ -1178,7 +1178,6 @@ def version_path(path):
# set RELEASE_OR_BETA and NIGHTLY_BUILD variables depending on the cycle we're in
# The logic works like this:
# - if we have "a1" in GRE_MILESTONE, we're building Nightly (define NIGHTLY_BUILD)
-# - otherwise, if we have "a" in GRE_MILESTONE, we're building Nightly or Aurora
# - otherwise, we're building Release/Beta (define RELEASE_OR_BETA)
@depends(check_build_environment, build_project, version_path, "--help")
@imports(_from="__builtin__", _import="open")
@@ -1225,7 +1224,7 @@ def milestone(build_env, build_project, version_path, _):
if "a1" in milestone:
is_nightly = True
- elif "a" not in milestone:
+ else:
is_release_or_beta = True
major_version = milestone.split(".")[0]
diff --git a/config/createprecomplete.py b/config/createprecomplete.py
index dda4efcdf8e1..39aa85182dcb 100644
--- a/config/createprecomplete.py
+++ b/config/createprecomplete.py
@@ -5,6 +5,7 @@
# update instructions which is used to remove files and directories that are no
# longer present in a complete update. The current working directory is used for
# the location to enumerate and to create the precomplete file.
+# For symlinks, remove instructions are always generated.
from __future__ import absolute_import
from __future__ import unicode_literals
@@ -13,9 +14,18 @@ import os
import io
+# TODO When TOR_BROWSER_DATA_OUTSIDE_APP_DIR is used on all platforms,
+# we should remove all lines in this file that contain:
+# TorBrowser/Data
+
+
def get_build_entries(root_path):
"""Iterates through the root_path, creating a list for each file and
directory. Excludes any file paths ending with channel-prefs.js.
+ To support Tor Browser updates, excludes:
+ TorBrowser/Data/Browser/profiles.ini
+ TorBrowser/Data/Browser/profile.default/bookmarks.html
+ TorBrowser/Data/Tor/torrc
"""
rel_file_path_set = set()
rel_dir_path_set = set()
@@ -27,6 +37,10 @@ def get_build_entries(root_path):
if not (
rel_path_file.endswith("channel-prefs.js")
or rel_path_file.endswith("update-settings.ini")
+ or rel_path_file == "TorBrowser/Data/Browser/profiles.ini"
+ or rel_path_file
+ == "TorBrowser/Data/Browser/profile.default/bookmarks.html"
+ or rel_path_file == "TorBrowser/Data/Tor/torrc"
or rel_path_file.find("distribution/") != -1
):
rel_file_path_set.add(rel_path_file)
@@ -36,7 +50,10 @@ def get_build_entries(root_path):
rel_path_dir = os.path.join(parent_dir_rel_path, dir_name)
rel_path_dir = rel_path_dir.replace("\\", "/") + "/"
if rel_path_dir.find("distribution/") == -1:
- rel_dir_path_set.add(rel_path_dir)
+ if os.path.islink(rel_path_dir[:-1]):
+ rel_file_path_set.add(rel_path_dir[:-1])
+ else:
+ rel_dir_path_set.add(rel_path_dir)
rel_file_path_list = list(rel_file_path_set)
rel_file_path_list.sort(reverse=True)
diff --git a/devtools/client/aboutdebugging/src/actions/runtimes.js b/devtools/client/aboutdebugging/src/actions/runtimes.js
index 3d9ce0490bf2..00dff36f28a2 100644
--- a/devtools/client/aboutdebugging/src/actions/runtimes.js
+++ b/devtools/client/aboutdebugging/src/actions/runtimes.js
@@ -71,6 +71,11 @@ async function getRuntimeIcon(runtime, channel) {
}
}
+ // Use the release build skin for devtools within Tor Browser alpha releases.
+ if (channel === "alpha") {
+ return "chrome://devtools/skin/images/aboutdebugging-firefox-release.svg";
+ }
+
return channel === "release" || channel === "beta" || channel === "aurora"
? `chrome://devtools/skin/images/aboutdebugging-firefox-${channel}.svg`
: "chrome://devtools/skin/images/aboutdebugging-firefox-nightly.svg";
diff --git a/toolkit/modules/UpdateUtils.jsm b/toolkit/modules/UpdateUtils.jsm
index a8eff4c783af..abfaacdd075d 100644
--- a/toolkit/modules/UpdateUtils.jsm
+++ b/toolkit/modules/UpdateUtils.jsm
@@ -96,7 +96,7 @@ var UpdateUtils = {
case "PRODUCT":
return Services.appinfo.name;
case "VERSION":
- return Services.appinfo.version;
+ return AppConstants.TOR_BROWSER_VERSION;
case "BUILD_ID":
return Services.appinfo.appBuildID;
case "BUILD_TARGET":
@@ -160,7 +160,8 @@ var UpdateUtils = {
* downloads and installs updates. This corresponds to whether or not the user
* has selected "Automatically install updates" in about:preferences.
*
- * On Windows, this setting is shared across all profiles for the installation
+ * On Windows (except in Tor Browser), this setting is shared across all profiles
+ * for the installation
* and is read asynchronously from the file. On other operating systems, this
* setting is stored in a pref and is thus a per-profile setting.
*
@@ -176,7 +177,8 @@ var UpdateUtils = {
* updates" and "Check for updates but let you choose to install them" options
* in about:preferences.
*
- * On Windows, this setting is shared across all profiles for the installation
+ * On Windows (except in Tor Browser), this setting is shared across all profiles
+ * for the installation
* and is written asynchronously to the file. On other operating systems, this
* setting is stored in a pref and is thus a per-profile setting.
*
@@ -248,7 +250,7 @@ var UpdateUtils = {
// setting is just to propagate it from a pref observer. This ensures that
// the expected observers still get notified, even if a user manually
// changes the pref value.
- if (!UpdateUtils.PER_INSTALLATION_PREFS_SUPPORTED) {
+ if (AppConstants.TOR_BROWSER_UPDATE || !UpdateUtils.PER_INSTALLATION_PREFS_SUPPORTED) {
let initialConfig = {};
for (const [prefName, pref] of Object.entries(
UpdateUtils.PER_INSTALLATION_PREFS
@@ -315,7 +317,7 @@ var UpdateUtils = {
}
}
- if (!this.PER_INSTALLATION_PREFS_SUPPORTED) {
+ if (AppConstants.TOR_BROWSER_UPDATE || !this.PER_INSTALLATION_PREFS_SUPPORTED) {
// If we don't have per-installation prefs, we use regular preferences.
let prefValue = prefTypeFns.getProfilePref(prefName, pref.defaultValue);
return Promise.resolve(prefValue);
@@ -405,7 +407,7 @@ var UpdateUtils = {
);
}
- if (!this.PER_INSTALLATION_PREFS_SUPPORTED) {
+ if (AppConstants.TOR_BROWSER_UPDATE || !this.PER_INSTALLATION_PREFS_SUPPORTED) {
// If we don't have per-installation prefs, we use regular preferences.
if (options.setDefaultOnly) {
prefTypeFns.setProfileDefaultPref(prefName, value);
@@ -539,14 +541,6 @@ UpdateUtils.PER_INSTALLATION_PREFS = {
migrate: true,
observerTopic: "auto-update-config-change",
policyFn: () => {
- if (!Services.policies.isAllowed("app-auto-updates-off")) {
- // We aren't allowed to turn off auto-update - it is forced on.
- return true;
- }
- if (!Services.policies.isAllowed("app-auto-updates-on")) {
- // We aren't allowed to turn on auto-update - it is forced off.
- return false;
- }
return null;
},
},
diff --git a/toolkit/mozapps/extensions/AddonManager.jsm b/toolkit/mozapps/extensions/AddonManager.jsm
index 7cf750d0ffc7..61b3fb8ec3da 100644
--- a/toolkit/mozapps/extensions/AddonManager.jsm
+++ b/toolkit/mozapps/extensions/AddonManager.jsm
@@ -23,6 +23,7 @@ const { AppConstants } = ChromeUtils.import(
const MOZ_COMPATIBILITY_NIGHTLY = ![
"aurora",
+ "alpha",
"beta",
"release",
"esr",
@@ -37,6 +38,7 @@ const PREF_EM_AUTOUPDATE_DEFAULT = "extensions.update.autoUpdateDefault";
const PREF_EM_STRICT_COMPATIBILITY = "extensions.strictCompatibility";
const PREF_EM_CHECK_UPDATE_SECURITY = "extensions.checkUpdateSecurity";
const PREF_SYS_ADDON_UPDATE_ENABLED = "extensions.systemAddon.update.enabled";
+const PREF_EM_LAST_TORBROWSER_VERSION = "extensions.lastTorBrowserVersion";
const PREF_MIN_WEBEXT_PLATFORM_VERSION =
"extensions.webExtensionsMinPlatformVersion";
@@ -700,6 +702,28 @@ var AddonManagerInternal = {
);
}
+ // To ensure that extension and plugin code gets a chance to run
+ // after each browser update, set appChanged = true when the
+ // Tor Browser version has changed even if the Mozilla app
+ // version has not changed.
+ let tbChanged = undefined;
+ try {
+ tbChanged = AppConstants.TOR_BROWSER_VERSION !=
+ Services.prefs.getCharPref(PREF_EM_LAST_TORBROWSER_VERSION);
+ }
+ catch (e) { }
+ if (tbChanged !== false) {
+ // Because PREF_EM_LAST_TORBROWSER_VERSION was not present in older
+ // versions of Tor Browser, an app change is indicated when tbChanged
+ // is undefined or true.
+ if (appChanged === false) {
+ appChanged = true;
+ }
+
+ Services.prefs.setCharPref(PREF_EM_LAST_TORBROWSER_VERSION,
+ AppConstants.TOR_BROWSER_VERSION);
+ }
+
if (!MOZ_COMPATIBILITY_NIGHTLY) {
PREF_EM_CHECK_COMPATIBILITY =
PREF_EM_CHECK_COMPATIBILITY_BASE +
diff --git a/toolkit/mozapps/extensions/test/browser/head.js b/toolkit/mozapps/extensions/test/browser/head.js
index ffc5142a804d..eabb7d0f7cce 100644
--- a/toolkit/mozapps/extensions/test/browser/head.js
+++ b/toolkit/mozapps/extensions/test/browser/head.js
@@ -43,6 +43,7 @@ var PREF_CHECK_COMPATIBILITY;
var channel = Services.prefs.getCharPref("app.update.channel", "default");
if (
channel != "aurora" &&
+ channel != "alpha" &&
channel != "beta" &&
channel != "release" &&
channel != "esr"
diff --git a/toolkit/mozapps/extensions/test/xpcshell/head_addons.js b/toolkit/mozapps/extensions/test/xpcshell/head_addons.js
index 204a25594296..0a5408d20535 100644
--- a/toolkit/mozapps/extensions/test/xpcshell/head_addons.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/head_addons.js
@@ -390,6 +390,7 @@ function isNightlyChannel() {
return (
channel != "aurora" &&
+ channel != "alpha" &&
channel != "beta" &&
channel != "release" &&
channel != "esr"
diff --git a/toolkit/mozapps/update/UpdateService.jsm b/toolkit/mozapps/update/UpdateService.jsm
index b200e18c5e8f..8f835468a8a0 100644
--- a/toolkit/mozapps/update/UpdateService.jsm
+++ b/toolkit/mozapps/update/UpdateService.jsm
@@ -32,11 +32,15 @@ XPCOMUtils.defineLazyModuleGetters(this, {
AddonManager: "resource://gre/modules/AddonManager.jsm",
AsyncShutdown: "resource://gre/modules/AsyncShutdown.jsm",
CertUtils: "resource://gre/modules/CertUtils.jsm",
+#ifdef XP_WIN
ctypes: "resource://gre/modules/ctypes.jsm",
+#endif
DeferredTask: "resource://gre/modules/DeferredTask.jsm",
setTimeout: "resource://gre/modules/Timer.jsm",
UpdateUtils: "resource://gre/modules/UpdateUtils.jsm",
+#if !defined(TOR_BROWSER_UPDATE)
WindowsRegistry: "resource://gre/modules/WindowsRegistry.jsm",
+#endif
});
if (AppConstants.ENABLE_REMOTE_AGENT) {
@@ -472,6 +476,7 @@ function testWriteAccess(updateTestFile, createDirectory) {
updateTestFile.remove(false);
}
+#ifdef XP_WIN
/**
* Windows only function that closes a Win32 handle.
*
@@ -564,6 +569,7 @@ function getPerInstallationMutexName(aGlobal = true) {
(aGlobal ? "Global\\" : "") + "MozillaUpdateMutex-" + hasher.finish(true)
);
}
+#endif
/**
* Whether or not the current instance has the update mutex. The update mutex
@@ -574,6 +580,7 @@ function getPerInstallationMutexName(aGlobal = true) {
* @return true if this instance holds the update mutex
*/
function hasUpdateMutex() {
+#ifdef XP_WIN
if (AppConstants.platform != "win") {
return true;
}
@@ -581,6 +588,9 @@ function hasUpdateMutex() {
gUpdateMutexHandle = createMutex(getPerInstallationMutexName(true), false);
}
return !!gUpdateMutexHandle;
+#else
+ return true;
+#endif
}
/**
@@ -611,6 +621,11 @@ function areDirectoryEntriesWriteable(aDir) {
* @return true if elevation is required, false otherwise
*/
function getElevationRequired() {
+#if defined(TOR_BROWSER_UPDATE)
+ // To avoid potential security holes associated with running the updater
+ // process with elevated privileges, Tor Browser does not support elevation.
+ return false;
+#else
if (AppConstants.platform != "macosx") {
return false;
}
@@ -645,6 +660,7 @@ function getElevationRequired() {
"not required"
);
return false;
+#endif
}
/**
@@ -694,6 +710,7 @@ function getCanApplyUpdates() {
return false;
}
+#if !defined(TOR_BROWSER_UPDATE)
if (AppConstants.platform == "macosx") {
LOG(
"getCanApplyUpdates - bypass the write since elevation can be used " +
@@ -709,6 +726,7 @@ function getCanApplyUpdates() {
);
return true;
}
+#endif
try {
if (AppConstants.platform == "win") {
@@ -1519,6 +1537,9 @@ function handleUpdateFailure(update, errorCode) {
cancelations++;
Services.prefs.setIntPref(PREF_APP_UPDATE_CANCELATIONS, cancelations);
if (AppConstants.platform == "macosx") {
+#if defined(TOR_BROWSER_UPDATE)
+ cleanupActiveUpdate();
+#else
let osxCancelations = Services.prefs.getIntPref(
PREF_APP_UPDATE_CANCELATIONS_OSX,
0
@@ -1542,6 +1563,7 @@ function handleUpdateFailure(update, errorCode) {
(update.state = STATE_PENDING_ELEVATE)
);
}
+#endif
update.statusText = gUpdateBundle.GetStringFromName("elevationFailure");
} else {
writeStatusFile(getReadyUpdateDir(), (update.state = STATE_PENDING));
@@ -2136,7 +2158,26 @@ function Update(update) {
this._patches.push(patch);
}
- if (!this._patches.length && !update.hasAttribute("unsupported")) {
+ if (update.hasAttribute("unsupported")) {
+ this.unsupported = ("true" == update.getAttribute("unsupported"));
+ } else if (update.hasAttribute("minSupportedOSVersion")) {
+ let minOSVersion = update.getAttribute("minSupportedOSVersion");
+ try {
+ let osVersion = Services.sysinfo.getProperty("version");
+ this.unsupported = (Services.vc.compare(osVersion, minOSVersion) < 0);
+ } catch (e) {}
+ }
+ if (!this.unsupported && update.hasAttribute("minSupportedInstructionSet")) {
+ let minInstructionSet = update.getAttribute("minSupportedInstructionSet");
+ if (['MMX', 'SSE', 'SSE2', 'SSE3',
+ 'SSE4A', 'SSE4_1', 'SSE4_2'].indexOf(minInstructionSet) >= 0) {
+ try {
+ this.unsupported = !Services.sysinfo.getProperty("has" + minInstructionSet);
+ } catch (e) {}
+ }
+ }
+
+ if (!this._patches.length && !this.unsupported) {
throw Components.Exception("", Cr.NS_ERROR_ILLEGAL_VALUE);
}
@@ -2174,9 +2215,7 @@ function Update(update) {
if (!isNaN(attr.value)) {
this.promptWaitTime = parseInt(attr.value);
}
- } else if (attr.name == "unsupported") {
- this.unsupported = attr.value == "true";
- } else {
+ } else if (attr.name != "unsupported") {
switch (attr.name) {
case "appVersion":
case "buildID":
@@ -2201,7 +2240,11 @@ function Update(update) {
}
if (!this.previousAppVersion) {
+#ifdef TOR_BROWSER_UPDATE
+ this.previousAppVersion = AppConstants.TOR_BROWSER_VERSION;
+#else
this.previousAppVersion = Services.appinfo.version;
+#endif
}
if (!this.elevationFailure) {
@@ -2584,6 +2627,7 @@ UpdateService.prototype = {
Services.obs.removeObserver(this, topic);
Services.prefs.removeObserver(PREF_APP_UPDATE_LOG, this);
+#ifdef XP_WIN
if (AppConstants.platform == "win" && gUpdateMutexHandle) {
// If we hold the update mutex, let it go!
// The OS would clean this up sometime after shutdown,
@@ -2591,6 +2635,7 @@ UpdateService.prototype = {
closeHandle(gUpdateMutexHandle);
gUpdateMutexHandle = null;
}
+#endif
if (this._retryTimer) {
this._retryTimer.cancel();
}
@@ -2616,6 +2661,7 @@ UpdateService.prototype = {
}
break;
case "test-close-handle-update-mutex":
+#ifdef XP_WIN
if (Cu.isInAutomation) {
if (AppConstants.platform == "win" && gUpdateMutexHandle) {
LOG("UpdateService:observe - closing mutex handle for testing");
@@ -2623,6 +2669,7 @@ UpdateService.prototype = {
gUpdateMutexHandle = null;
}
}
+#endif
break;
}
},
@@ -2654,6 +2701,9 @@ UpdateService.prototype = {
return;
}
gUpdateFileWriteInfo = { phase: "startup", failure: false };
+#if defined(TOR_BROWSER_UPDATE) && !defined(XP_MACOSX)
+ this._removeOrphanedTorBrowserFiles();
+#endif
if (!this.canCheckForUpdates) {
LOG(
"UpdateService:_postUpdateProcessing - unable to check for " +
@@ -2965,6 +3015,42 @@ UpdateService.prototype = {
}
},
+#if defined(TOR_BROWSER_UPDATE) && !defined(XP_MACOSX)
+ /**
+ * When updating from an earlier version to Tor Browser 6.0 or later, old
+ * update info files are left behind on Linux and Windows. Remove them.
+ */
+ _removeOrphanedTorBrowserFiles: function AUS__removeOrphanedTorBrowserFiles() {
+ try {
+ let oldUpdateInfoDir = getAppBaseDir(); // aka the Browser directory.
+
+#ifdef XP_WIN
+ // On Windows, the updater files were stored under
+ // Browser/TorBrowser/Data/Browser/Caches/firefox/
+ oldUpdateInfoDir.appendRelativePath(
+ "TorBrowser\\Data\\Browser\\Caches\\firefox");
+#endif
+
+ // Remove the updates directory.
+ let updatesDir = oldUpdateInfoDir.clone();
+ updatesDir.append("updates");
+ if (updatesDir.exists() && updatesDir.isDirectory()) {
+ updatesDir.remove(true);
+ }
+
+ // Remove files: active-update.xml and updates.xml
+ let filesToRemove = [ "active-update.xml", "updates.xml" ];
+ filesToRemove.forEach(function(aFileName) {
+ let f = oldUpdateInfoDir.clone();
+ f.append(aFileName);
+ if (f.exists()) {
+ f.remove(false);
+ }
+ });
+ } catch (e) {}
+ },
+#endif
+
/**
* Register an observer when the network comes online, so we can short-circuit
* the app.update.interval when there isn't connectivity
@@ -3375,9 +3461,14 @@ UpdateService.prototype = {
updates.forEach(function(aUpdate) {
// Ignore updates for older versions of the application and updates for
// the same version of the application with the same build ID.
- if (
- vc.compare(aUpdate.appVersion, Services.appinfo.version) < 0 ||
- (vc.compare(aUpdate.appVersion, Services.appinfo.version) == 0 &&
+#ifdef TOR_BROWSER_UPDATE
+ let compatVersion = AppConstants.TOR_BROWSER_VERSION;
+#else
+ let compatVersion = Services.appinfo.version;
+#endif
+ let rc = vc.compare(aUpdate.appVersion, compatVersion);
+ if (rc < 0 ||
+ (rc == 0 &&
aUpdate.buildID == Services.appinfo.appBuildID)
) {
LOG(
@@ -3795,20 +3886,32 @@ UpdateService.prototype = {
// build ID. If we already have an update ready, we want to apply those
// same checks against the version of the ready update, so that we don't
// download an update that isn't newer than the one we already have.
+#ifdef TOR_BROWSER_UPDATE
+ let compatVersion = AppConstants.TOR_BROWSER_VERSION;
+#else
+ let compatVersion = Services.appinfo.version;
+#endif
if (
updateIsAtLeastAsOldAs(
update,
- Services.appinfo.version,
+ compatVersion,
Services.appinfo.appBuildID
)
) {
LOG(
"UpdateService:downloadUpdate - canceling download of update since " +
"it is for an earlier or same application version and build ID.\n" +
+#ifdef TOR_BROWSER_UPDATE
+ "current Tor Browser version: " +
+ compatVersion +
+ "\n" +
+ "update Tor Browser version : " +
+#else
"current application version: " +
- Services.appinfo.version +
+ compatVersion +
"\n" +
"update application version : " +
+#endif
update.appVersion +
"\n" +
"current build ID: " +
@@ -4472,6 +4575,7 @@ Checker.prototype = {
*/
_callback: null,
+#if !defined(TOR_BROWSER_UPDATE)
_getCanMigrate: function UC__getCanMigrate() {
if (AppConstants.platform != "win") {
return false;
@@ -4541,6 +4645,7 @@ Checker.prototype = {
LOG("Checker:_getCanMigrate - no registry entries for this installation");
return false;
},
+#endif // !defined(TOR_BROWSER_UPDATE)
/**
* The URL of the update service XML file to connect to that contains details
@@ -4569,9 +4674,11 @@ Checker.prototype = {
url += (url.includes("?") ? "&" : "?") + "force=1";
}
+#if !defined(TOR_BROWSER_UPDATE)
if (this._getCanMigrate()) {
url += (url.includes("?") ? "&" : "?") + "mig64=1";
}
+#endif
LOG("Checker:getUpdateURL - update URL: " + url);
return url;
diff --git a/toolkit/mozapps/update/UpdateServiceStub.jsm b/toolkit/mozapps/update/UpdateServiceStub.jsm
index 45b9177a06cb..ab4bbfc0884c 100644
--- a/toolkit/mozapps/update/UpdateServiceStub.jsm
+++ b/toolkit/mozapps/update/UpdateServiceStub.jsm
@@ -84,8 +84,12 @@ function UpdateServiceStub() {
// contains the status file's path
// We may need to migrate update data
+ // In Tor Browser we skip this because we do not use an update agent and we
+ // do not want to store any data outside of the browser installation directory.
+ // For more info, see https://bugzilla.mozilla.org/show_bug.cgi?id=1458314
if (
AppConstants.platform == "win" &&
+ !AppConstants.TOR_BROWSER_UPDATE &&
!Services.prefs.getBoolPref(prefUpdateDirMigrated, false)
) {
migrateUpdateDirectory();
diff --git a/toolkit/mozapps/update/common/updatehelper.cpp b/toolkit/mozapps/update/common/updatehelper.cpp
index b094d9eb75e9..c825d3c1ea8e 100644
--- a/toolkit/mozapps/update/common/updatehelper.cpp
+++ b/toolkit/mozapps/update/common/updatehelper.cpp
@@ -66,6 +66,13 @@ BOOL PathGetSiblingFilePath(LPWSTR destinationBuffer, LPCWSTR siblingFilePath,
* @return TRUE if successful
*/
BOOL GetSecureOutputDirectoryPath(LPWSTR outBuf) {
+#ifdef TOR_BROWSER_UPDATE
+ // This function is used to support the maintenance service and elevated
+ // updates and is therefore not called by Tor Browser's updater. We stub
+ // it out to avoid any chance that the Tor Browser updater will create
+ // files under C:\Program Files (x86)\ or a similar location.
+ return FALSE;
+#else
PWSTR progFilesX86;
if (FAILED(SHGetKnownFolderPath(FOLDERID_ProgramFilesX86, KF_FLAG_CREATE,
nullptr, &progFilesX86))) {
@@ -99,6 +106,7 @@ BOOL GetSecureOutputDirectoryPath(LPWSTR outBuf) {
}
return TRUE;
+#endif
}
/**
diff --git a/toolkit/mozapps/update/moz.build b/toolkit/mozapps/update/moz.build
index 1852712b3cee..4ec06e6341ab 100644
--- a/toolkit/mozapps/update/moz.build
+++ b/toolkit/mozapps/update/moz.build
@@ -22,11 +22,14 @@ EXTRA_COMPONENTS += [
EXTRA_JS_MODULES += [
"UpdateListener.jsm",
- "UpdateService.jsm",
"UpdateServiceStub.jsm",
"UpdateTelemetry.jsm",
]
+EXTRA_PP_JS_MODULES += [
+ "UpdateService.jsm",
+]
+
XPCOM_MANIFESTS += [
"components.conf",
]
diff --git a/toolkit/mozapps/update/updater/launchchild_osx.mm b/toolkit/mozapps/update/updater/launchchild_osx.mm
index 3074c0da065b..a48318ece4c3 100644
--- a/toolkit/mozapps/update/updater/launchchild_osx.mm
+++ b/toolkit/mozapps/update/updater/launchchild_osx.mm
@@ -372,6 +372,7 @@ bool ObtainUpdaterArguments(int* argc, char*** argv) {
@end
+#ifndef TOR_BROWSER_UPDATE
bool ServeElevatedUpdate(int argc, const char** argv) {
MacAutoreleasePool pool;
@@ -387,6 +388,7 @@ bool ServeElevatedUpdate(int argc, const char** argv) {
[updater release];
return didSucceed;
}
+#endif
bool IsOwnedByGroupAdmin(const char* aAppBundle) {
MacAutoreleasePool pool;
diff --git a/toolkit/mozapps/update/updater/moz.build b/toolkit/mozapps/update/updater/moz.build
index 40d7a77a6b62..ac7f82a4f9ad 100644
--- a/toolkit/mozapps/update/updater/moz.build
+++ b/toolkit/mozapps/update/updater/moz.build
@@ -51,7 +51,7 @@ xpcshell_cert.script = "gen_cert_header.py:create_header"
dep1_cert.script = "gen_cert_header.py:create_header"
dep2_cert.script = "gen_cert_header.py:create_header"
-if CONFIG["MOZ_UPDATE_CHANNEL"] in ("beta", "release", "esr"):
+if CONFIG["MOZ_UPDATE_CHANNEL"] in ("alpha", "beta", "release", "esr"):
primary_cert.inputs += ["release_primary.der"]
secondary_cert.inputs += ["release_secondary.der"]
elif CONFIG["MOZ_UPDATE_CHANNEL"] in (
diff --git a/toolkit/mozapps/update/updater/updater.cpp b/toolkit/mozapps/update/updater/updater.cpp
index a8a6d175d6dd..8b53090f8508 100644
--- a/toolkit/mozapps/update/updater/updater.cpp
+++ b/toolkit/mozapps/update/updater/updater.cpp
@@ -16,7 +16,7 @@
* updatev3.manifest
* -----------------
* method = "add" | "add-if" | "add-if-not" | "patch" | "patch-if" |
- * "remove" | "rmdir" | "rmrfdir" | type
+ * "remove" | "rmdir" | "rmrfdir" | "addsymlink" | type
*
* 'add-if-not' adds a file if it doesn't exist.
*
@@ -78,7 +78,9 @@ bool IsRecursivelyWritable(const char* aPath);
void LaunchChild(int argc, const char** argv);
void LaunchMacPostProcess(const char* aAppBundle);
bool ObtainUpdaterArguments(int* argc, char*** argv);
+# ifndef TOR_BROWSER_UPDATE
bool ServeElevatedUpdate(int argc, const char** argv);
+# endif
void SetGroupOwnershipAndPermissions(const char* aAppBundle);
struct UpdateServerThreadArgs {
int argc;
@@ -479,9 +481,12 @@ static const NS_tchar* get_relative_path(const NS_tchar* fullpath) {
* The line from the manifest that contains the path.
* @param isdir
* Whether the path is a directory path. Defaults to false.
+ * @param islinktarget
+ * Whether the path is a symbolic link target. Defaults to false.
* @return valid filesystem path or nullptr if the path checks fail.
*/
-static NS_tchar* get_valid_path(NS_tchar** line, bool isdir = false) {
+static NS_tchar* get_valid_path(NS_tchar** line, bool isdir = false,
+ bool islinktarget = false) {
NS_tchar* path = mstrtok(kQuote, line);
if (!path) {
LOG(("get_valid_path: unable to determine path: " LOG_S, *line));
@@ -517,10 +522,12 @@ static NS_tchar* get_valid_path(NS_tchar** line, bool isdir = false) {
path[NS_tstrlen(path) - 1] = NS_T('\0');
}
- // Don't allow relative paths that resolve to a parent directory.
- if (NS_tstrstr(path, NS_T("..")) != nullptr) {
- LOG(("get_valid_path: paths must not contain '..': " LOG_S, path));
- return nullptr;
+ if (!islinktarget) {
+ // Don't allow relative paths that resolve to a parent directory.
+ if (NS_tstrstr(path, NS_T("..")) != nullptr) {
+ LOG(("get_valid_path: paths must not contain '..': " LOG_S, path));
+ return nullptr;
+ }
}
return path;
@@ -560,7 +567,7 @@ static void ensure_write_permissions(const NS_tchar* path) {
(void)_wchmod(path, _S_IREAD | _S_IWRITE);
#else
struct stat fs;
- if (!stat(path, &fs) && !(fs.st_mode & S_IWUSR)) {
+ if (!lstat(path, &fs) && !S_ISLNK(fs.st_mode) && !(fs.st_mode & S_IWUSR)) {
(void)chmod(path, fs.st_mode | S_IWUSR);
}
#endif
@@ -747,11 +754,9 @@ static int ensure_copy(const NS_tchar* path, const NS_tchar* dest) {
return READ_ERROR;
}
-# ifdef XP_UNIX
if (S_ISLNK(ss.st_mode)) {
return ensure_copy_symlink(path, dest);
}
-# endif
AutoFile infile(ensure_open(path, NS_T("rb"), ss.st_mode));
if (!infile) {
@@ -838,12 +843,19 @@ static int ensure_copy_recursive(const NS_tchar* path, const NS_tchar* dest,
return READ_ERROR;
}
-#ifdef XP_UNIX
+#ifndef XP_WIN
if (S_ISLNK(sInfo.st_mode)) {
return ensure_copy_symlink(path, dest);
}
#endif
+#ifdef XP_UNIX
+ // Ignore Unix domain sockets. See #20691.
+ if (S_ISSOCK(sInfo.st_mode)) {
+ return 0;
+ }
+#endif
+
if (!S_ISDIR(sInfo.st_mode)) {
return ensure_copy(path, dest);
}
@@ -900,7 +912,7 @@ static int rename_file(const NS_tchar* spath, const NS_tchar* dpath,
}
struct NS_tstat_t spathInfo;
- rv = NS_tstat(spath, &spathInfo);
+ rv = NS_tlstat(spath, &spathInfo); // Get info about file or symlink.
if (rv) {
LOG(("rename_file: failed to read file status info: " LOG_S ", "
"err: %d",
@@ -908,7 +920,12 @@ static int rename_file(const NS_tchar* spath, const NS_tchar* dpath,
return READ_ERROR;
}
- if (!S_ISREG(spathInfo.st_mode)) {
+#ifdef XP_WIN
+ if (!S_ISREG(spathInfo.st_mode))
+#else
+ if (!S_ISREG(spathInfo.st_mode) && !S_ISLNK(spathInfo.st_mode))
+#endif
+ {
if (allowDirs && !S_ISDIR(spathInfo.st_mode)) {
LOG(("rename_file: path present, but not a file: " LOG_S ", err: %d",
spath, errno));
@@ -917,7 +934,12 @@ static int rename_file(const NS_tchar* spath, const NS_tchar* dpath,
LOG(("rename_file: proceeding to rename the directory"));
}
- if (!NS_taccess(dpath, F_OK)) {
+#ifdef XP_WIN
+ if (!NS_taccess(dpath, F_OK))
+#else
+ if (!S_ISLNK(spathInfo.st_mode) && !NS_taccess(dpath, F_OK))
+#endif
+ {
if (ensure_remove(dpath)) {
LOG(
("rename_file: destination file exists and could not be "
@@ -937,7 +959,7 @@ static int rename_file(const NS_tchar* spath, const NS_tchar* dpath,
return OK;
}
-#ifdef XP_WIN
+#if defined(XP_WIN) && !defined(TOR_BROWSER_UPDATE)
// Remove the directory pointed to by path and all of its files and
// sub-directories. If a file is in use move it to the tobedeleted directory
// and attempt to schedule removal of the file on reboot
@@ -1036,7 +1058,19 @@ static int backup_restore(const NS_tchar* path, const NS_tchar* relPath) {
NS_tsnprintf(relBackup, sizeof(relBackup) / sizeof(relBackup[0]),
NS_T("%s") BACKUP_EXT, relPath);
- if (NS_taccess(backup, F_OK)) {
+ bool isLink = false;
+#ifndef XP_WIN
+ struct stat linkInfo;
+ int rv = lstat(backup, &linkInfo);
+ if (rv) {
+ LOG(("backup_restore: cannot get info for backup file: " LOG_S ", err: %d",
+ relBackup, errno));
+ return OK;
+ }
+ isLink = S_ISLNK(linkInfo.st_mode);
+#endif
+
+ if (!isLink && NS_taccess(backup, F_OK)) {
LOG(("backup_restore: backup file doesn't exist: " LOG_S, relBackup));
return OK;
}
@@ -1054,8 +1088,18 @@ static int backup_discard(const NS_tchar* path, const NS_tchar* relPath) {
NS_tsnprintf(relBackup, sizeof(relBackup) / sizeof(relBackup[0]),
NS_T("%s") BACKUP_EXT, relPath);
+ bool isLink = false;
+#ifndef XP_WIN
+ struct stat linkInfo;
+ int rv2 = lstat(backup, &linkInfo);
+ if (rv2) {
+ return OK; // File does not exist; nothing to do.
+ }
+ isLink = S_ISLNK(linkInfo.st_mode);
+#endif
+
// Nothing to discard
- if (NS_taccess(backup, F_OK)) {
+ if (!isLink && NS_taccess(backup, F_OK)) {
return OK;
}
@@ -1070,6 +1114,8 @@ static int backup_discard(const NS_tchar* path, const NS_tchar* relPath) {
relBackup, relPath));
return WRITE_ERROR_DELETE_BACKUP;
}
+
+# if !defined(TOR_BROWSER_UPDATE)
// The MoveFileEx call to remove the file on OS reboot will fail if the
// process doesn't have write access to the HKEY_LOCAL_MACHINE registry key
// but this is ok since the installer / uninstaller will delete the
@@ -1086,6 +1132,7 @@ static int backup_discard(const NS_tchar* path, const NS_tchar* relPath) {
"file: " LOG_S,
relPath));
}
+# endif
}
#else
if (rv) {
@@ -1140,7 +1187,7 @@ class Action {
class RemoveFile : public Action {
public:
- RemoveFile() : mSkip(0) {}
+ RemoveFile() : mSkip(0), mIsLink(0) {}
int Parse(NS_tchar* line) override;
int Prepare() override;
@@ -1151,6 +1198,7 @@ class RemoveFile : public Action {
mozilla::UniquePtr<NS_tchar[]> mFile;
mozilla::UniquePtr<NS_tchar[]> mRelPath;
int mSkip;
+ int mIsLink;
};
int RemoveFile::Parse(NS_tchar* line) {
@@ -1173,28 +1221,39 @@ int RemoveFile::Parse(NS_tchar* line) {
}
int RemoveFile::Prepare() {
- // Skip the file if it already doesn't exist.
- int rv = NS_taccess(mFile.get(), F_OK);
- if (rv) {
- mSkip = 1;
- mProgressCost = 0;
- return OK;
+ int rv;
+#ifndef XP_WIN
+ struct stat linkInfo;
+ rv = lstat(mFile.get(), &linkInfo);
+ mIsLink = ((0 == rv) && S_ISLNK(linkInfo.st_mode));
+#endif
+
+ if (!mIsLink) {
+ // Skip the file if it already doesn't exist.
+ rv = NS_taccess(mFile.get(), F_OK);
+ if (rv) {
+ mSkip = 1;
+ mProgressCost = 0;
+ return OK;
+ }
}
LOG(("PREPARE REMOVEFILE " LOG_S, mRelPath.get()));
- // Make sure that we're actually a file...
- struct NS_tstat_t fileInfo;
- rv = NS_tstat(mFile.get(), &fileInfo);
- if (rv) {
- LOG(("failed to read file status info: " LOG_S ", err: %d", mFile.get(),
- errno));
- return READ_ERROR;
- }
+ if (!mIsLink) {
+ // Make sure that we're actually a file...
+ struct NS_tstat_t fileInfo;
+ rv = NS_tstat(mFile.get(), &fileInfo);
+ if (rv) {
+ LOG(("failed to read file status info: " LOG_S ", err: %d", mFile.get(),
+ errno));
+ return READ_ERROR;
+ }
- if (!S_ISREG(fileInfo.st_mode)) {
- LOG(("path present, but not a file: " LOG_S, mFile.get()));
- return DELETE_ERROR_EXPECTED_FILE;
+ if (!S_ISREG(fileInfo.st_mode)) {
+ LOG(("path present, but not a file: " LOG_S, mFile.get()));
+ return DELETE_ERROR_EXPECTED_FILE;
+ }
}
NS_tchar* slash = (NS_tchar*)NS_tstrrchr(mFile.get(), NS_T('/'));
@@ -1223,7 +1282,13 @@ int RemoveFile::Execute() {
// The file is checked for existence here and in Prepare since it might have
// been removed by a separate instruction: bug 311099.
- int rv = NS_taccess(mFile.get(), F_OK);
+ int rv = 0;
+ if (mIsLink) {
+ struct NS_tstat_t linkInfo;
+ rv = NS_tlstat(mFile.get(), &linkInfo);
+ } else {
+ rv = NS_taccess(mFile.get(), F_OK);
+ }
if (rv) {
LOG(("file cannot be removed because it does not exist; skipping"));
mSkip = 1;
@@ -1946,6 +2011,92 @@ void PatchIfFile::Finish(int status) {
PatchFile::Finish(status);
}
+#ifndef XP_WIN
+class AddSymlink : public Action {
+ public:
+ AddSymlink() : mAdded(false) {}
+
+ virtual int Parse(NS_tchar* line);
+ virtual int Prepare();
+ virtual int Execute();
+ virtual void Finish(int status);
+
+ private:
+ mozilla::UniquePtr<NS_tchar[]> mLinkPath;
+ mozilla::UniquePtr<NS_tchar[]> mRelPath;
+ mozilla::UniquePtr<NS_tchar[]> mTarget;
+ bool mAdded;
+};
+
+int AddSymlink::Parse(NS_tchar* line) {
+ // format "<linkname>" "target"
+
+ NS_tchar* validPath = get_valid_path(&line);
+ if (!validPath) return PARSE_ERROR;
+
+ mRelPath = mozilla::MakeUnique<NS_tchar[]>(MAXPATHLEN);
+ NS_tstrcpy(mRelPath.get(), validPath);
+ mLinkPath.reset(get_full_path(validPath));
+ if (!mLinkPath) {
+ return PARSE_ERROR;
+ }
+
+ // consume whitespace between args
+ NS_tchar* q = mstrtok(kQuote, &line);
+ if (!q) return PARSE_ERROR;
+
+ validPath = get_valid_path(&line, false, true);
+ if (!validPath) return PARSE_ERROR;
+
+ mTarget = mozilla::MakeUnique<NS_tchar[]>(MAXPATHLEN);
+ NS_tstrcpy(mTarget.get(), validPath);
+
+ return OK;
+}
+
+int AddSymlink::Prepare() {
+ LOG(("PREPARE ADDSYMLINK " LOG_S " -> " LOG_S, mRelPath.get(),
+ mTarget.get()));
+
+ return OK;
+}
+
+int AddSymlink::Execute() {
+ LOG(("EXECUTE ADDSYMLINK " LOG_S " -> " LOG_S, mRelPath.get(),
+ mTarget.get()));
+
+ // First make sure that we can actually get rid of any existing file or link.
+ struct stat linkInfo;
+ int rv = lstat(mLinkPath.get(), &linkInfo);
+ if ((0 == rv) && !S_ISLNK(linkInfo.st_mode)) {
+ rv = NS_taccess(mLinkPath.get(), F_OK);
+ }
+ if (rv == 0) {
+ rv = backup_create(mLinkPath.get());
+ if (rv) return rv;
+ } else {
+ rv = ensure_parent_dir(mLinkPath.get());
+ if (rv) return rv;
+ }
+
+ // Create the link.
+ rv = symlink(mTarget.get(), mLinkPath.get());
+ if (!rv) {
+ mAdded = true;
+ }
+
+ return rv;
+}
+
+void AddSymlink::Finish(int status) {
+ LOG(("FINISH ADDSYMLINK " LOG_S " -> " LOG_S, mRelPath.get(), mTarget.get()));
+ // When there is an update failure and a link has been added it is removed
+ // here since there might not be a backup to replace it.
+ if (status && mAdded) NS_tremove(mLinkPath.get());
+ backup_finish(mLinkPath.get(), mRelPath.get(), status);
+}
+#endif
+
//-----------------------------------------------------------------------------
#ifdef XP_WIN
@@ -2268,14 +2419,29 @@ static bool IsSecureUpdateStatusSucceeded(bool& isSucceeded) {
*/
static int CopyInstallDirToDestDir() {
// These files should not be copied over to the updated app
-#ifdef XP_WIN
-# define SKIPLIST_COUNT 3
-#elif XP_MACOSX
-# define SKIPLIST_COUNT 0
+#if defined(TOR_BROWSER_UPDATE) && !defined(TOR_BROWSER_DATA_OUTSIDE_APP_DIR)
+# ifdef XP_WIN
+# define SKIPLIST_COUNT 6
+# else
+# define SKIPLIST_COUNT 5
+# endif
#else
-# define SKIPLIST_COUNT 2
+# ifdef XP_WIN
+# define SKIPLIST_COUNT 3
+# elif XP_MACOSX
+# define SKIPLIST_COUNT 0
+# else
+# define SKIPLIST_COUNT 2
+# endif
#endif
copy_recursive_skiplist<SKIPLIST_COUNT> skiplist;
+#if defined(TOR_BROWSER_UPDATE) && !defined(TOR_BROWSER_DATA_OUTSIDE_APP_DIR)
+# ifdef XP_MACOSX
+ skiplist.append(0, gInstallDirPath, NS_T("Updated.app"));
+ skiplist.append(1, gInstallDirPath, NS_T("TorBrowser/UpdateInfo/updates/0"));
+# endif
+#endif
+
#ifndef XP_MACOSX
skiplist.append(0, gInstallDirPath, NS_T("updated"));
skiplist.append(1, gInstallDirPath, NS_T("updates/0"));
@@ -2284,6 +2450,19 @@ static int CopyInstallDirToDestDir() {
# endif
#endif
+#if defined(TOR_BROWSER_UPDATE) && !defined(TOR_BROWSER_DATA_OUTSIDE_APP_DIR)
+# ifdef XP_WIN
+ skiplist.append(SKIPLIST_COUNT - 3, gInstallDirPath,
+ NS_T("TorBrowser/Data/Browser/profile.default/parent.lock"));
+# else
+ skiplist.append(SKIPLIST_COUNT - 3, gInstallDirPath,
+ NS_T("TorBrowser/Data/Browser/profile.default/.parentlock"));
+# endif
+
+ skiplist.append(SKIPLIST_COUNT - 1, gInstallDirPath,
+ NS_T("TorBrowser/Data/Tor/lock"));
+#endif
+
return ensure_copy_recursive(gInstallDirPath, gWorkingDirPath, skiplist);
}
@@ -2421,7 +2600,9 @@ static int ProcessReplaceRequest() {
if (NS_taccess(deleteDir, F_OK)) {
NS_tmkdir(deleteDir, 0755);
}
+# if !defined(TOR_BROWSER_UPDATE)
remove_recursive_on_reboot(tmpDir, deleteDir);
+# endif
#endif
}
@@ -2429,8 +2610,45 @@ static int ProcessReplaceRequest() {
// On OS X, we we need to remove the staging directory after its Contents
// directory has been moved.
NS_tchar updatedAppDir[MAXPATHLEN];
+# if defined(TOR_BROWSER_UPDATE) && !defined(TOR_BROWSER_DATA_OUTSIDE_APP_DIR)
+ NS_tsnprintf(updatedAppDir, sizeof(updatedAppDir) / sizeof(updatedAppDir[0]),
+ NS_T("%s/Updated.app"), gInstallDirPath);
+ // For Tor Browser on OS X, we also need to copy everything else that is
+ // inside Updated.app.
+ NS_tDIR* dir = NS_topendir(updatedAppDir);
+ if (dir) {
+ NS_tdirent* entry;
+ while ((entry = NS_treaddir(dir)) != 0) {
+ if (NS_tstrcmp(entry->d_name, NS_T(".")) &&
+ NS_tstrcmp(entry->d_name, NS_T(".."))) {
+ NS_tchar childSrcPath[MAXPATHLEN];
+ NS_tsnprintf(childSrcPath,
+ sizeof(childSrcPath) / sizeof(childSrcPath[0]),
+ NS_T("%s/%s"), updatedAppDir, entry->d_name);
+ NS_tchar childDstPath[MAXPATHLEN];
+ NS_tsnprintf(childDstPath,
+ sizeof(childDstPath) / sizeof(childDstPath[0]),
+ NS_T("%s/%s"), gInstallDirPath, entry->d_name);
+ ensure_remove_recursive(childDstPath);
+ rv = rename_file(childSrcPath, childDstPath, true);
+ if (rv) {
+ LOG(("Moving " LOG_S " to " LOG_S " failed, err: %d", childSrcPath,
+ childDstPath, errno));
+ }
+ }
+ }
+
+ NS_tclosedir(dir);
+ } else {
+ LOG(("Updated.app dir can't be found: " LOG_S ", err: %d", updatedAppDir,
+ errno));
+ }
+# else
NS_tsnprintf(updatedAppDir, sizeof(updatedAppDir) / sizeof(updatedAppDir[0]),
NS_T("%s/Updated.app"), gPatchDirPath);
+# endif
+
+ // Remove the Updated.app directory.
ensure_remove_recursive(updatedAppDir);
#endif
@@ -2604,11 +2822,15 @@ static void UpdateThreadFunc(void* param) {
#ifdef XP_MACOSX
static void ServeElevatedUpdateThreadFunc(void* param) {
+# ifdef TOR_BROWSER_UPDATE
+ WriteStatusFile(ELEVATION_CANCELED);
+# else
UpdateServerThreadArgs* threadArgs = (UpdateServerThreadArgs*)param;
gSucceeded = ServeElevatedUpdate(threadArgs->argc, threadArgs->argv);
if (!gSucceeded) {
WriteStatusFile(ELEVATION_CANCELED);
}
+# endif
QuitProgressUI();
}
@@ -2632,7 +2854,7 @@ int LaunchCallbackAndPostProcessApps(int argc, NS_tchar** argv,
#endif
) {
if (argc > callbackIndex) {
-#if defined(XP_WIN)
+#if defined(XP_WIN) && !defined(TOR_BROWSER_UPDATE)
if (gSucceeded) {
if (!LaunchWinPostProcess(gInstallDirPath, gPatchDirPath)) {
fprintf(stderr, "The post update process was not launched");
@@ -2687,8 +2909,12 @@ int NS_main(int argc, NS_tchar** argv) {
UmaskContext umaskContext(0);
bool isElevated =
+# ifdef TOR_BROWSER_UPDATE
+ false;
+# else
strstr(argv[0], "/Library/PrivilegedHelperTools/org.mozilla.updater") !=
0;
+# endif
if (isElevated) {
if (!ObtainUpdaterArguments(&argc, &argv)) {
// Won't actually get here because ObtainUpdaterArguments will terminate
@@ -3312,6 +3538,26 @@ int NS_main(int argc, NS_tchar** argv) {
// using the service is because we are testing.
if (!useService && !noServiceFallback &&
updateLockFileHandle == INVALID_HANDLE_VALUE) {
+# ifdef TOR_BROWSER_UPDATE
+# ifdef TOR_BROWSER_DATA_OUTSIDE_APP_DIR
+ // Because the TorBrowser-Data directory that contains the user's
+ // profile is a sibling of the Tor Browser installation directory,
+ // the user probably has permission to apply updates. Therefore, to
+ // avoid potential security issues such as CVE-2015-0833, do not
+ // attempt to elevate privileges. Instead, write a "failed" message
+ // to the update status file (this function will return immediately
+ // after the CloseHandle(elevatedFileHandle) call below).
+# else
+ // Because the user profile is contained within the Tor Browser
+ // installation directory, the user almost certainly has permission to
+ // apply updates. Therefore, to avoid potential security issues such
+ // as CVE-2015-0833, do not attempt to elevate privileges. Instead,
+ // write a "failed" message to the update status file (this function
+ // will return immediately after the CloseHandle(elevatedFileHandle)
+ // call below).
+# endif
+ WriteStatusFile(WRITE_ERROR_ACCESS_DENIED);
+# else
// Get the secure ID before trying to update so it is possible to
// determine if the updater has created a new one.
char uuidStringBefore[UUID_LEN] = {'\0'};
@@ -3357,6 +3603,7 @@ int NS_main(int argc, NS_tchar** argv) {
gCopyOutputFiles = false;
WriteStatusFile(ELEVATION_CANCELED);
}
+# endif
}
// If we started the elevated updater, and it finished, check the secure
@@ -3704,6 +3951,7 @@ int NS_main(int argc, NS_tchar** argv) {
if (!sStagedUpdate && !sReplaceRequest && _wrmdir(gDeleteDirPath)) {
LOG(("NS_main: unable to remove directory: " LOG_S ", err: %d", DELETE_DIR,
errno));
+# if !defined(TOR_BROWSER_UPDATE)
// The directory probably couldn't be removed due to it containing files
// that are in use and will be removed on OS reboot. The call to remove the
// directory on OS reboot is done after the calls to remove the files so the
@@ -3722,6 +3970,7 @@ int NS_main(int argc, NS_tchar** argv) {
"directory: " LOG_S,
DELETE_DIR));
}
+# endif
}
#endif /* XP_WIN */
@@ -4363,7 +4612,13 @@ int DoUpdate() {
action = new AddIfNotFile();
} else if (NS_tstrcmp(token, NS_T("patch-if")) == 0) { // Patch if exists
action = new PatchIfFile();
- } else {
+ }
+#ifndef XP_WIN
+ else if (NS_tstrcmp(token, NS_T("addsymlink")) == 0) {
+ action = new AddSymlink();
+ }
+#endif
+ else {
LOG(("DoUpdate: unknown token: " LOG_S, token));
free(buf);
return PARSE_ERROR;
diff --git a/toolkit/xre/MacLaunchHelper.h b/toolkit/xre/MacLaunchHelper.h
index f8dc75ee4d08..ce816acd83e2 100644
--- a/toolkit/xre/MacLaunchHelper.h
+++ b/toolkit/xre/MacLaunchHelper.h
@@ -17,7 +17,9 @@ extern "C" {
* pid of the terminated process to confirm that it executed successfully.
*/
void LaunchChildMac(int aArgc, char** aArgv, pid_t* aPid = 0);
+#ifndef TOR_BROWSER_UPDATE
bool LaunchElevatedUpdate(int aArgc, char** aArgv, pid_t* aPid = 0);
+#endif
}
#endif
diff --git a/toolkit/xre/MacLaunchHelper.mm b/toolkit/xre/MacLaunchHelper.mm
index ec570ffab124..da2917c2a99e 100644
--- a/toolkit/xre/MacLaunchHelper.mm
+++ b/toolkit/xre/MacLaunchHelper.mm
@@ -40,6 +40,7 @@ void LaunchChildMac(int aArgc, char** aArgv, pid_t* aPid) {
}
}
+#ifndef TOR_BROWSER_UPDATE
BOOL InstallPrivilegedHelper() {
AuthorizationRef authRef = NULL;
OSStatus status = AuthorizationCreate(
@@ -116,3 +117,4 @@ bool LaunchElevatedUpdate(int aArgc, char** aArgv, pid_t* aPid) {
}
return didSucceed;
}
+#endif
diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp
index e96ad9241f98..6956ac5d9e4e 100644
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -3240,6 +3240,11 @@ static bool CheckCompatibility(nsIFile* aProfileDir, const nsCString& aVersion,
gLastAppBuildID.Assign(gAppData->buildID);
nsAutoCString buf;
+
+ nsAutoCString tbVersion(TOR_BROWSER_VERSION_QUOTED);
+ rv = parser.GetString("Compatibility", "LastTorBrowserVersion", buf);
+ if (NS_FAILED(rv) || !tbVersion.Equals(buf)) return false;
+
rv = parser.GetString("Compatibility", "LastOSABI", buf);
if (NS_FAILED(rv) || !aOSABI.Equals(buf)) return false;
@@ -3325,6 +3330,12 @@ static void WriteVersion(nsIFile* aProfileDir, const nsCString& aVersion,
PR_Write(fd, kHeader, sizeof(kHeader) - 1);
PR_Write(fd, aVersion.get(), aVersion.Length());
+ nsAutoCString tbVersion(TOR_BROWSER_VERSION_QUOTED);
+ static const char kTorBrowserVersionHeader[] =
+ NS_LINEBREAK "LastTorBrowserVersion=";
+ PR_Write(fd, kTorBrowserVersionHeader, sizeof(kTorBrowserVersionHeader) - 1);
+ PR_Write(fd, tbVersion.get(), tbVersion.Length());
+
static const char kOSABIHeader[] = NS_LINEBREAK "LastOSABI=";
PR_Write(fd, kOSABIHeader, sizeof(kOSABIHeader) - 1);
PR_Write(fd, aOSABI.get(), aOSABI.Length());
@@ -4831,8 +4842,17 @@ int XREMain::XRE_mainStartup(bool* aExitFlag) {
if (CheckArg("test-process-updates")) {
SaveToEnv("MOZ_TEST_PROCESS_UPDATES=1");
}
+# ifdef TOR_BROWSER_UPDATE
+ nsAutoCString compatVersion(TOR_BROWSER_VERSION_QUOTED);
+# endif
ProcessUpdates(mDirProvider.GetGREDir(), exeDir, updRoot, gRestartArgc,
- gRestartArgv, mAppData->version);
+ gRestartArgv,
+# ifdef TOR_BROWSER_UPDATE
+ compatVersion.get()
+# else
+ mAppData->version
+# endif
+ );
if (EnvHasValue("MOZ_TEST_PROCESS_UPDATES")) {
SaveToEnv("MOZ_TEST_PROCESS_UPDATES=");
*aExitFlag = true;
diff --git a/toolkit/xre/nsUpdateDriver.cpp b/toolkit/xre/nsUpdateDriver.cpp
index 0f126247725d..96ac89267e3f 100644
--- a/toolkit/xre/nsUpdateDriver.cpp
+++ b/toolkit/xre/nsUpdateDriver.cpp
@@ -163,6 +163,13 @@ static nsresult GetInstallDirPath(nsIFile* appDir, nsACString& installDirPath) {
return NS_OK;
}
+#ifdef DEBUG
+static void dump_argv(const char* aPrefix, char** argv, int argc) {
+ printf("%s - %d args\n", aPrefix, argc);
+ for (int i = 0; i < argc; ++i) printf(" %d: %s\n", i, argv[i]);
+}
+#endif
+
static bool GetFile(nsIFile* dir, const nsACString& name,
nsCOMPtr<nsIFile>& result) {
nsresult rv;
@@ -224,6 +231,34 @@ typedef enum {
eAppliedService,
} UpdateStatus;
+#ifdef DEBUG
+static const char* UpdateStatusToString(UpdateStatus aStatus) {
+ const char* rv = "unknown";
+ switch (aStatus) {
+ case eNoUpdateAction:
+ rv = "NoUpdateAction";
+ break;
+ case ePendingUpdate:
+ rv = "PendingUpdate";
+ break;
+ case ePendingService:
+ rv = "PendingService";
+ break;
+ case ePendingElevate:
+ rv = "PendingElevate";
+ break;
+ case eAppliedUpdate:
+ rv = "AppliedUpdate";
+ break;
+ case eAppliedService:
+ rv = "AppliedService";
+ break;
+ }
+
+ return rv;
+}
+#endif
+
/**
* Returns a value indicating what needs to be done in order to handle an
* update.
@@ -296,9 +331,39 @@ static bool IsOlderVersion(nsIFile* versionFile, const char* appVersion) {
return false;
}
+#ifdef DEBUG
+ printf("IsOlderVersion checking appVersion %s against updateVersion %s\n",
+ appVersion, buf);
+#endif
+
return mozilla::Version(appVersion) > buf;
}
+#ifndef TOR_BROWSER_DATA_OUTSIDE_APP_DIR
+# if defined(TOR_BROWSER_UPDATE) && defined(XP_MACOSX)
+static nsresult GetUpdateDirFromAppDir(nsIFile* aAppDir, nsIFile** aResult) {
+ // On Mac OSX, we stage the update to an Updated.app directory that is
+ // directly below the main Tor Browser.app directory (two levels up from
+ // the appDir).
+ NS_ENSURE_ARG_POINTER(aAppDir);
+ NS_ENSURE_ARG_POINTER(aResult);
+ nsCOMPtr<nsIFile> parentDir1, parentDir2;
+ nsresult rv = aAppDir->GetParent(getter_AddRefs(parentDir1));
+ NS_ENSURE_SUCCESS(rv, rv);
+ rv = parentDir1->GetParent(getter_AddRefs(parentDir2));
+ NS_ENSURE_SUCCESS(rv, rv);
+
+ nsCOMPtr<nsIFile> updatedDir;
+ if (!GetFile(parentDir2, "Updated.app"_ns, updatedDir)) {
+ return NS_ERROR_FAILURE;
+ }
+
+ updatedDir.forget(aResult);
+ return NS_OK;
+}
+# endif
+#endif
+
/**
* Applies, switches, or stages an update.
*
@@ -446,7 +511,12 @@ static void ApplyUpdate(nsIFile* greDir, nsIFile* updateDir, nsIFile* appDir,
} else {
// Get the directory where the update is staged or will be staged.
#if defined(XP_MACOSX)
+# if defined(TOR_BROWSER_UPDATE) && !defined(TOR_BROWSER_DATA_OUTSIDE_APP_DIR)
+ rv = GetUpdateDirFromAppDir(appDir, getter_AddRefs(updatedDir));
+ if (NS_FAILED(rv)) {
+# else
if (!GetFile(updateDir, "Updated.app"_ns, updatedDir)) {
+# endif
#else
if (!GetFile(appDir, "updated"_ns, updatedDir)) {
#endif
@@ -541,6 +611,9 @@ static void ApplyUpdate(nsIFile* greDir, nsIFile* updateDir, nsIFile* appDir,
}
LOG(("spawning updater process [%s]\n", updaterPath.get()));
+#ifdef DEBUG
+ dump_argv("ApplyUpdate updater", argv, argc);
+#endif
#if defined(XP_UNIX) && !defined(XP_MACOSX)
// We use execv to spawn the updater process on all UNIX systems except Mac
@@ -579,6 +652,10 @@ static void ApplyUpdate(nsIFile* greDir, nsIFile* updateDir, nsIFile* appDir,
}
#elif defined(XP_MACOSX)
UpdateDriverSetupMacCommandLine(argc, argv, restart);
+# ifdef DEBUG
+dump_argv("ApplyUpdate after SetupMacCommandLine", argv, argc);
+# endif
+# ifndef TOR_BROWSER_UPDATE
// We need to detect whether elevation is required for this update. This can
// occur when an admin user installs the application, but another admin
// user attempts to update (see bug 394984).
@@ -591,6 +668,7 @@ if (restart && !IsRecursivelyWritable(installDirPath.get())) {
}
exit(0);
}
+# endif
if (isStaged) {
// Launch the updater to replace the installation with the staged updated.
@@ -661,9 +739,27 @@ static bool ProcessHasTerminated(ProcessType pt) {
nsresult ProcessUpdates(nsIFile* greDir, nsIFile* appDir, nsIFile* updRootDir,
int argc, char** argv, const char* appVersion,
bool restart, ProcessType* pid) {
+#if defined(XP_WIN) && defined(TOR_BROWSER_UPDATE)
+ // Try to remove the "tobedeleted" directory which, if present, contains
+ // files that could not be removed during a previous update (e.g., DLLs
+ // that were in use and therefore locked by Windows).
+ nsCOMPtr<nsIFile> deleteDir;
+ nsresult winrv = appDir->Clone(getter_AddRefs(deleteDir));
+ if (NS_SUCCEEDED(winrv)) {
+ winrv = deleteDir->AppendNative("tobedeleted"_ns);
+ if (NS_SUCCEEDED(winrv)) {
+ winrv = deleteDir->Remove(true);
+ }
+ }
+#endif
+
nsresult rv;
nsCOMPtr<nsIFile> updatesDir;
+#ifdef DEBUG
+ printf("ProcessUpdates updateRootDir: %s appVersion: %s\n",
+ updRootDir->HumanReadablePath().get(), appVersion);
+#endif
rv = updRootDir->Clone(getter_AddRefs(updatesDir));
NS_ENSURE_SUCCESS(rv, rv);
rv = updatesDir->AppendNative("updates"_ns);
@@ -683,6 +779,12 @@ nsresult ProcessUpdates(nsIFile* greDir, nsIFile* appDir, nsIFile* updRootDir,
nsCOMPtr<nsIFile> statusFile;
UpdateStatus status = GetUpdateStatus(updatesDir, statusFile);
+#ifdef DEBUG
+ printf("ProcessUpdates status: %s (%d)\n", UpdateStatusToString(status),
+ status);
+ printf("ProcessUpdates updatesDir: %s\n",
+ updatesDir->HumanReadablePath().get());
+#endif
switch (status) {
case ePendingUpdate:
case ePendingService: {
@@ -746,13 +848,16 @@ nsUpdateProcessor::ProcessUpdate() {
NS_ENSURE_SUCCESS(rv, rv);
}
+ nsAutoCString appVersion;
+#ifdef TOR_BROWSER_UPDATE
+ appVersion = TOR_BROWSER_VERSION_QUOTED;
+#else
nsCOMPtr<nsIXULAppInfo> appInfo =
do_GetService("@mozilla.org/xre/app-info;1", &rv);
NS_ENSURE_SUCCESS(rv, rv);
-
- nsAutoCString appVersion;
rv = appInfo->GetVersion(appVersion);
NS_ENSURE_SUCCESS(rv, rv);
+#endif
// Copy the parameters to the StagedUpdateInfo structure shared with the
// watcher thread.
diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp
index dd9cd4e6c3b4..96a52186f878 100644
--- a/toolkit/xre/nsXREDirProvider.cpp
+++ b/toolkit/xre/nsXREDirProvider.cpp
@@ -1299,6 +1299,41 @@ nsresult nsXREDirProvider::GetUpdateRootDir(nsIFile** aResult,
}
#endif
nsCOMPtr<nsIFile> updRoot;
+#if defined(TOR_BROWSER_UPDATE)
+ // For Tor Browser, we store update history, etc. within the UpdateInfo
+ // directory under the user data directory.
+ nsresult rv = GetTorBrowserUserDataDir(getter_AddRefs(updRoot));
+ NS_ENSURE_SUCCESS(rv, rv);
+ rv = updRoot->AppendNative("UpdateInfo"_ns);
+ NS_ENSURE_SUCCESS(rv, rv);
+# if defined(XP_MACOSX) && defined(TOR_BROWSER_DATA_OUTSIDE_APP_DIR)
+ // Since the TorBrowser-Data directory may be shared among different
+ // installations of the application, embed the app path in the update dir
+ // so that the update history is partitioned. This is much less likely to
+ // be an issue on Linux or Windows because the Tor Browser packages for
+ // those platforms include a "container" folder that provides partitioning
+ // by default, and we do not support use of a shared, OS-recommended area
+ // for user data on those platforms.
+ nsCOMPtr<nsIFile> appFile;
+ bool per = false;
+ rv = GetFile(XRE_EXECUTABLE_FILE, &per, getter_AddRefs(appFile));
+ NS_ENSURE_SUCCESS(rv, rv);
+ nsCOMPtr<nsIFile> appRootDirFile;
+ nsAutoString appDirPath;
+ if (NS_FAILED(appFile->GetParent(getter_AddRefs(appRootDirFile))) ||
+ NS_FAILED(appRootDirFile->GetPath(appDirPath))) {
+ return NS_ERROR_FAILURE;
+ }
+
+ int32_t dotIndex = appDirPath.RFind(".app");
+ if (dotIndex == kNotFound) {
+ dotIndex = appDirPath.Length();
+ }
+ appDirPath = Substring(appDirPath, 1, dotIndex - 1);
+ rv = updRoot->AppendRelativePath(appDirPath);
+ NS_ENSURE_SUCCESS(rv, rv);
+# endif
+#else // ! TOR_BROWSER_UPDATE
nsCOMPtr<nsIFile> appFile;
bool per = false;
nsresult rv = GetFile(XRE_EXECUTABLE_FILE, &per, getter_AddRefs(appFile));
@@ -1306,7 +1341,7 @@ nsresult nsXREDirProvider::GetUpdateRootDir(nsIFile** aResult,
rv = appFile->GetParent(getter_AddRefs(updRoot));
NS_ENSURE_SUCCESS(rv, rv);
-#ifdef XP_MACOSX
+# ifdef XP_MACOSX
nsCOMPtr<nsIFile> appRootDirFile;
nsCOMPtr<nsIFile> localDir;
nsAutoString appDirPath;
@@ -1340,7 +1375,7 @@ nsresult nsXREDirProvider::GetUpdateRootDir(nsIFile** aResult,
localDir.forget(aResult);
return NS_OK;
-#elif XP_WIN
+# elif XP_WIN
nsAutoString installPath;
rv = updRoot->GetPath(installPath);
NS_ENSURE_SUCCESS(rv, rv);
@@ -1369,7 +1404,8 @@ nsresult nsXREDirProvider::GetUpdateRootDir(nsIFile** aResult,
nsAutoString updatePathStr;
updatePathStr.Assign(updatePath.get());
updRoot->InitWithPath(updatePathStr);
-#endif // XP_WIN
+# endif // XP_WIN
+#endif // ! TOR_BROWSER_UPDATE
updRoot.forget(aResult);
return NS_OK;
}
diff --git a/tools/update-packaging/common.sh b/tools/update-packaging/common.sh
index 4b994f30169c..26eabbf31379 100755
--- a/tools/update-packaging/common.sh
+++ b/tools/update-packaging/common.sh
@@ -8,6 +8,10 @@
# Author: Darin Fisher
#
+# TODO When TOR_BROWSER_DATA_OUTSIDE_APP_DIR is used on all platforms,
+# we should remove all lines in this file that contain:
+# TorBrowser/Data
+
# -----------------------------------------------------------------------------
QUIET=0
@@ -76,17 +80,8 @@ make_add_instruction() {
forced=
fi
- is_extension=$(echo "$f" | grep -c 'distribution/extensions/.*/')
- if [ $is_extension = "1" ]; then
- # Use the subdirectory of the extensions folder as the file to test
- # before performing this add instruction.
- testdir=$(echo "$f" | sed 's/\(.*distribution\/extensions\/[^\/]*\)\/.*/\1/')
- verbose_notice " add-if \"$testdir\" \"$f\""
- echo "add-if \"$testdir\" \"$f\"" >> "$filev3"
- else
- verbose_notice " add \"$f\"$forced"
- echo "add \"$f\"" >> "$filev3"
- fi
+ verbose_notice " add \"$f\"$forced"
+ echo "add \"$f\"" >> "$filev3"
}
check_for_add_if_not_update() {
@@ -109,21 +104,21 @@ make_add_if_not_instruction() {
echo "add-if-not \"$f\" \"$f\"" >> "$filev3"
}
+make_addsymlink_instruction() {
+ link="$1"
+ target="$2"
+ filev3="$3"
+
+ verbose_notice " addsymlink: $link -> $target"
+ echo "addsymlink \"$link\" \"$target\"" >> "$filev3"
+}
+
make_patch_instruction() {
f="$1"
filev3="$2"
- is_extension=$(echo "$f" | grep -c 'distribution/extensions/.*/')
- if [ $is_extension = "1" ]; then
- # Use the subdirectory of the extensions folder as the file to test
- # before performing this add instruction.
- testdir=$(echo "$f" | sed 's/\(.*distribution\/extensions\/[^\/]*\)\/.*/\1/')
- verbose_notice " patch-if \"$testdir\" \"$f.patch\" \"$f\""
- echo "patch-if \"$testdir\" \"$f.patch\" \"$f\"" >> "$filev3"
- else
- verbose_notice " patch \"$f.patch\" \"$f\""
- echo "patch \"$f.patch\" \"$f\"" >> "$filev3"
- fi
+ verbose_notice " patch \"$f.patch\" \"$f\""
+ echo "patch \"$f.patch\" \"$f\"" >> "$filev3"
}
append_remove_instructions() {
@@ -168,6 +163,10 @@ append_remove_instructions() {
# List all files in the current directory, stripping leading "./"
# Pass a variable name and it will be filled as an array.
+# To support Tor Browser updates, skip the following files:
+# TorBrowser/Data/Browser/profiles.ini
+# TorBrowser/Data/Browser/profile.default/bookmarks.html
+# TorBrowser/Data/Tor/torrc
list_files() {
count=0
temp_filelist=$(mktemp)
@@ -178,6 +177,11 @@ list_files() {
| sed 's/\.\/\(.*\)/\1/' \
| sort -r > "${temp_filelist}"
while read file; do
+ if [ "$file" = "TorBrowser/Data/Browser/profiles.ini" -o \
+ "$file" = "TorBrowser/Data/Browser/profile.default/bookmarks.html" -o \
+ "$file" = "TorBrowser/Data/Tor/torrc" ]; then
+ continue;
+ fi
eval "${1}[$count]=\"$file\""
(( count++ ))
done < "${temp_filelist}"
@@ -199,3 +203,19 @@ list_dirs() {
done < "${temp_dirlist}"
rm "${temp_dirlist}"
}
+
+# List all symbolic links in the current directory, stripping leading "./"
+list_symlinks() {
+ count=0
+
+ find . -type l \
+ | sed 's/\.\/\(.*\)/\1/' \
+ | sort -r > "temp-symlinklist"
+ while read symlink; do
+ target=$(readlink "$symlink")
+ eval "${1}[$count]=\"$symlink\""
+ eval "${2}[$count]=\"$target\""
+ (( count++ ))
+ done < "temp-symlinklist"
+ rm "temp-symlinklist"
+}
diff --git a/tools/update-packaging/make_full_update.sh b/tools/update-packaging/make_full_update.sh
index db2c5898efdc..603988997405 100755
--- a/tools/update-packaging/make_full_update.sh
+++ b/tools/update-packaging/make_full_update.sh
@@ -71,6 +71,7 @@ if [ ! -f "precomplete" ]; then
fi
list_files files
+list_symlinks symlinks symlink_targets
popd
@@ -81,6 +82,21 @@ notice "Adding type instruction to update manifests"
notice " type complete"
echo "type \"complete\"" >> "$updatemanifestv3"
+# TODO When TOR_BROWSER_DATA_OUTSIDE_APP_DIR is used on all platforms,
+# we should remove the following lines:
+# If removal of any old, existing directories is desired, emit the appropriate
+# rmrfdir commands.
+notice ""
+notice "Adding directory removal instructions to update manifests"
+for dir_to_remove in $directories_to_remove; do
+ # rmrfdir requires a trailing slash; if slash is missing, add one.
+ if ! [[ "$dir_to_remove" =~ /$ ]]; then
+ dir_to_remove="${dir_to_remove}/"
+ fi
+ echo "rmrfdir \"$dir_to_remove\"" >> "$updatemanifestv3"
+done
+# END TOR_BROWSER_DATA_OUTSIDE_APP_DIR removal
+
notice ""
notice "Adding file add instructions to update manifests"
num_files=${#files[*]}
@@ -102,6 +118,15 @@ for ((i=0; $i<$num_files; i=$i+1)); do
targetfiles="$targetfiles \"$f\""
done
+notice ""
+notice "Adding symlink add instructions to update manifests"
+num_symlinks=${#symlinks[*]}
+for ((i=0; $i<$num_symlinks; i=$i+1)); do
+ link="${symlinks[$i]}"
+ target="${symlink_targets[$i]}"
+ make_addsymlink_instruction "$link" "$target" "$updatemanifestv3"
+done
+
# Append remove instructions for any dead files.
notice ""
notice "Adding file and directory remove instructions from file 'removed-files'"
diff --git a/tools/update-packaging/make_incremental_update.sh b/tools/update-packaging/make_incremental_update.sh
index 24d68616731a..1adfef8fd96e 100755
--- a/tools/update-packaging/make_incremental_update.sh
+++ b/tools/update-packaging/make_incremental_update.sh
@@ -78,7 +78,11 @@ if [ $# = 0 ]; then
exit 1
fi
-requested_forced_updates='Contents/MacOS/firefox'
+# Firefox uses requested_forced_updates='Contents/MacOS/firefox' due to
+# 770996 but in Tor Browser we do not need that fix.
+requested_forced_updates=""
+directories_to_remove=""
+extra_files_to_remove=""
while getopts "hqf:" flag
do
@@ -114,6 +118,28 @@ workdir="$(mktemp -d)"
updatemanifestv3="$workdir/updatev3.manifest"
archivefiles="updatev3.manifest"
+# TODO When TOR_BROWSER_DATA_OUTSIDE_APP_DIR is used on all platforms,
+# we should remove the following lines:
+# If the NoScript extension has changed between
+# releases, add it to the "force updates" list.
+ext_path='TorBrowser/Data/Browser/profile.default/extensions'
+if [ -d "$newdir/$ext_path" ]; then
+ noscript='{73a6fe31-595d-460b-a920-fcc0f8843232}.xpi'
+
+ # NoScript is a packed extension, so we simply compare the old and the new
+ # .xpi files.
+ noscript_path="$ext_path/$noscript"
+ diff -a "$olddir/$noscript_path" "$newdir/$noscript_path" > /dev/null
+ rc=$?
+ if [ $rc -gt 1 ]; then
+ notice "Unexpected exit $rc from $noscript_path diff command"
+ exit 2
+ elif [ $rc -eq 1 ]; then
+ requested_forced_updates="$requested_forced_updates $noscript_path"
+ fi
+fi
+# END TOR_BROWSER_DATA_OUTSIDE_APP_DIR removal
+
mkdir -p "$workdir"
# Generate a list of all files in the target directory.
@@ -124,6 +150,7 @@ fi
list_files oldfiles
list_dirs olddirs
+list_symlinks oldsymlinks oldsymlink_targets
popd
@@ -141,6 +168,7 @@ fi
list_dirs newdirs
list_files newfiles
+list_symlinks newsymlinks newsymlink_targets
popd
@@ -151,6 +179,22 @@ notice "Adding type instruction to update manifests"
notice " type partial"
echo "type \"partial\"" >> $updatemanifestv3
+# TODO When TOR_BROWSER_DATA_OUTSIDE_APP_DIR is used on all platforms,
+# we should remove the following lines:
+# If removal of any old, existing directories is desired, emit the appropriate
+# rmrfdir commands.
+notice ""
+notice "Adding directory removal instructions to update manifests"
+for dir_to_remove in $directories_to_remove; do
+ # rmrfdir requires a trailing slash, so add one if missing.
+ if ! [[ "$dir_to_remove" =~ /$ ]]; then
+ dir_to_remove="${dir_to_remove}/"
+ fi
+ echo "rmrfdir \"$dir_to_remove\"" >> "$updatemanifestv3"
+done
+# END TOR_BROWSER_DATA_OUTSIDE_APP_DIR removal
+
+
notice ""
notice "Adding file patch and add instructions to update manifests"
@@ -242,6 +286,23 @@ for ((i=0; $i<$num_oldfiles; i=$i+1)); do
fi
done
+# Remove and re-add symlinks
+notice ""
+notice "Adding symlink remove/add instructions to update manifests"
+num_oldsymlinks=${#oldsymlinks[*]}
+for ((i=0; $i<$num_oldsymlinks; i=$i+1)); do
+ link="${oldsymlinks[$i]}"
+ verbose_notice " remove: $link"
+ echo "remove \"$link\"" >> "$updatemanifestv3"
+done
+
+num_newsymlinks=${#newsymlinks[*]}
+for ((i=0; $i<$num_newsymlinks; i=$i+1)); do
+ link="${newsymlinks[$i]}"
+ target="${newsymlink_targets[$i]}"
+ make_addsymlink_instruction "$link" "$target" "$updatemanifestv3"
+done
+
# Newly added files
notice ""
notice "Adding file add instructions to update manifests"
@@ -286,6 +347,14 @@ notice ""
notice "Adding file and directory remove instructions from file 'removed-files'"
append_remove_instructions "$newdir" "$updatemanifestv3"
+# TODO When TOR_BROWSER_DATA_OUTSIDE_APP_DIR is used on all platforms,
+# we should remove the following lines:
+for f in $extra_files_to_remove; do
+ notice " remove \"$f\""
+ echo "remove \"$f\"" >> "$updatemanifestv3"
+done
+# END TOR_BROWSER_DATA_OUTSIDE_APP_DIR removal
+
notice ""
notice "Adding directory remove instructions for directories that no longer exist"
num_olddirs=${#olddirs[*]}
1
0