lists.torproject.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

tbb-commits

Thread Start a new thread
Threads by month
  • ----- 2026 -----
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • 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
tbb-commits@lists.torproject.org

  • 1 participants
  • 20430 discussions
[tor-browser-build/master] Bug 27903: Isolate Tor Browser from dconf-service
by boklm@torproject.org 30 Jan '20

30 Jan '20
commit 4e682a909ec2af4c0452934446392f7ff918d8d1 Author: cypherpunks <cypherpunks(a)torproject.org> Date: Thu Jan 30 13:52:50 2020 +0100 Bug 27903: Isolate Tor Browser from dconf-service --- projects/tor-browser/RelativeLink/start-tor-browser | 3 +++ 1 file changed, 3 insertions(+) diff --git a/projects/tor-browser/RelativeLink/start-tor-browser b/projects/tor-browser/RelativeLink/start-tor-browser index 9356d4c..624bb3c 100755 --- a/projects/tor-browser/RelativeLink/start-tor-browser +++ b/projects/tor-browser/RelativeLink/start-tor-browser @@ -346,6 +346,9 @@ setControlPortPasswd ${TOR_CONTROL_PASSWD:='"secret"'} export FONTCONFIG_PATH="${HOME}/TorBrowser/Data/fontconfig" export FONTCONFIG_FILE="fonts.conf" +# Avoid overwriting user's dconf values. Fixes #27903. +export GSETTINGS_BACKEND=memory + cd "${HOME}" # We pass all additional command-line arguments we get to Firefox.
1 0
0 0
[tor-browser-build/maint-9.0] Bug 32891: Add new IPv4/IPv6 default bridge.
by boklm@torproject.org 30 Jan '20

30 Jan '20
commit 82672d50af26c862214f3c1c2670897f94a9dbf9 Author: Philipp Winter <phw(a)nymity.ch> Date: Wed Jan 8 15:46:19 2020 +0100 Bug 32891: Add new IPv4/IPv6 default bridge. Toke Høiland-Jørgensen generously offered to set up a default bridge in Denmark. This fixes <https://bugs.torproject.org/32891>. --- projects/tor-browser/Bundle-Data/PTConfigs/bridge_prefs.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/projects/tor-browser/Bundle-Data/PTConfigs/bridge_prefs.js b/projects/tor-browser/Bundle-Data/PTConfigs/bridge_prefs.js index da3f2cd..a87aa58 100644 --- a/projects/tor-browser/Bundle-Data/PTConfigs/bridge_prefs.js +++ b/projects/tor-browser/Bundle-Data/PTConfigs/bridge_prefs.js @@ -16,6 +16,8 @@ pref("extensions.torlauncher.default_bridge.obfs4.11", "obfs4 193.11.166.194:270 pref("extensions.torlauncher.default_bridge.obfs4.12", "obfs4 193.11.166.194:27025 1AE2C08904527FEA90C4C4F8C1083EA59FBC6FAF cert=ItvYZzW5tn6v3G4UnQa6Qz04Npro6e81AP70YujmK/KXwDFPTs3aHXcHp4n8Vt6w/bv8cA iat-mode=0"); pref("extensions.torlauncher.default_bridge.obfs4.13", "obfs4 209.148.46.65:443 74FAD13168806246602538555B5521A0383A1875 cert=ssH+9rP8dG2NLDN2XuFw63hIO/9MNNinLmxQDpVa+7kTOa9/m+tGWT1SmSYpQ9uTBGa6Hw iat-mode=0"); pref("extensions.torlauncher.default_bridge.obfs4.14", "obfs4 146.57.248.225:22 10A6CD36A537FCE513A322361547444B393989F0 cert=K1gDtDAIcUfeLqbstggjIw2rtgIKqdIhUlHp82XRqNSq/mtAjp1BIC9vHKJ2FAEpGssTPw iat-mode=0"); +pref("extensions.torlauncher.default_bridge.obfs4.15", "obfs4 45.145.95.6:27015 C5B7CD6946FF10C5B3E89691A7D3F2C122D2117C cert=TD7PbUO0/0k6xYHMPW3vJxICfkMZNdkRrb63Zhl5j9dW3iRGiCx0A7mPhe5T2EDzQ35+Zw iat-mode=0"); +pref("extensions.torlauncher.default_bridge.obfs4.16", "obfs4 [2a0c:4d80:42:702::1]:27015 C5B7CD6946FF10C5B3E89691A7D3F2C122D2117C cert=TD7PbUO0/0k6xYHMPW3vJxICfkMZNdkRrb63Zhl5j9dW3iRGiCx0A7mPhe5T2EDzQ35+Zw iat-mode=0"); pref("extensions.torlauncher.default_bridge.meek-azure.1", "meek_lite 0.0.2.0:2 97700DFE9F483596DDA6264C4D7DF7641E1E39CE url=https://meek.azureedge.net/ front=ajax.aspnetcdn.com");
1 0
0 0
[tor-browser-build/master] Merge remote-tracking branch 'phw/task/32891'
by boklm@torproject.org 30 Jan '20

30 Jan '20
commit 215aed39ee177bd0a371e8e4b6d7de3fcf69ffed Merge: e1127b3 21faabf Author: Nicolas Vigier <boklm(a)torproject.org> Date: Thu Jan 30 13:31:34 2020 +0100 Merge remote-tracking branch 'phw/task/32891' projects/tor-browser/Bundle-Data/PTConfigs/bridge_prefs.js | 2 ++ 1 file changed, 2 insertions(+)
1 0
0 0
[tor-browser-build/master] Bug 32891: Add new IPv4/IPv6 default bridge.
by boklm@torproject.org 30 Jan '20

30 Jan '20
commit 21faabfdbf08dbf25ff1fcf77c54d684b15c6fa1 Author: Philipp Winter <phw(a)nymity.ch> Date: Wed Jan 8 15:46:19 2020 +0100 Bug 32891: Add new IPv4/IPv6 default bridge. Toke Høiland-Jørgensen generously offered to set up a default bridge in Denmark. This fixes <https://bugs.torproject.org/32891>. --- projects/tor-browser/Bundle-Data/PTConfigs/bridge_prefs.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/projects/tor-browser/Bundle-Data/PTConfigs/bridge_prefs.js b/projects/tor-browser/Bundle-Data/PTConfigs/bridge_prefs.js index da3f2cd..a87aa58 100644 --- a/projects/tor-browser/Bundle-Data/PTConfigs/bridge_prefs.js +++ b/projects/tor-browser/Bundle-Data/PTConfigs/bridge_prefs.js @@ -16,6 +16,8 @@ pref("extensions.torlauncher.default_bridge.obfs4.11", "obfs4 193.11.166.194:270 pref("extensions.torlauncher.default_bridge.obfs4.12", "obfs4 193.11.166.194:27025 1AE2C08904527FEA90C4C4F8C1083EA59FBC6FAF cert=ItvYZzW5tn6v3G4UnQa6Qz04Npro6e81AP70YujmK/KXwDFPTs3aHXcHp4n8Vt6w/bv8cA iat-mode=0"); pref("extensions.torlauncher.default_bridge.obfs4.13", "obfs4 209.148.46.65:443 74FAD13168806246602538555B5521A0383A1875 cert=ssH+9rP8dG2NLDN2XuFw63hIO/9MNNinLmxQDpVa+7kTOa9/m+tGWT1SmSYpQ9uTBGa6Hw iat-mode=0"); pref("extensions.torlauncher.default_bridge.obfs4.14", "obfs4 146.57.248.225:22 10A6CD36A537FCE513A322361547444B393989F0 cert=K1gDtDAIcUfeLqbstggjIw2rtgIKqdIhUlHp82XRqNSq/mtAjp1BIC9vHKJ2FAEpGssTPw iat-mode=0"); +pref("extensions.torlauncher.default_bridge.obfs4.15", "obfs4 45.145.95.6:27015 C5B7CD6946FF10C5B3E89691A7D3F2C122D2117C cert=TD7PbUO0/0k6xYHMPW3vJxICfkMZNdkRrb63Zhl5j9dW3iRGiCx0A7mPhe5T2EDzQ35+Zw iat-mode=0"); +pref("extensions.torlauncher.default_bridge.obfs4.16", "obfs4 [2a0c:4d80:42:702::1]:27015 C5B7CD6946FF10C5B3E89691A7D3F2C122D2117C cert=TD7PbUO0/0k6xYHMPW3vJxICfkMZNdkRrb63Zhl5j9dW3iRGiCx0A7mPhe5T2EDzQ35+Zw iat-mode=0"); pref("extensions.torlauncher.default_bridge.meek-azure.1", "meek_lite 0.0.2.0:2 97700DFE9F483596DDA6264C4D7DF7641E1E39CE url=https://meek.azureedge.net/ front=ajax.aspnetcdn.com");
1 0
0 0
[tor-browser/tor-browser-68.4.1esr-9.5-1] Bug 1590538 - Don't pass an empty object to urlbar-user-start-navigation because it doesn't handle it properly. r=Standard8
by boklm@torproject.org 30 Jan '20

30 Jan '20
commit d361b0b2c8e51cec5088233006be152c340b6553 Author: Marco Bonardo <mbonardo(a)mozilla.com> Date: Wed Oct 30 14:25:02 2019 +0000 Bug 1590538 - Don't pass an empty object to urlbar-user-start-navigation because it doesn't handle it properly. r=Standard8 Differential Revision: https://phabricator.services.mozilla.com/D50634 --HG-- extra : moz-landing-system : lando --- browser/components/urlbar/UrlbarInput.jsm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/browser/components/urlbar/UrlbarInput.jsm b/browser/components/urlbar/UrlbarInput.jsm index cb0ab15d7ebf..21a7a5d9910f 100644 --- a/browser/components/urlbar/UrlbarInput.jsm +++ b/browser/components/urlbar/UrlbarInput.jsm @@ -1217,9 +1217,9 @@ class UrlbarInput { * @param {nsIInputStream} [params.postData] * The POST data associated with a search submission. * @param {boolean} [params.allowInheritPrincipal] - * If the principal may be inherited - * @param {object} [result] - * Details of the selected result, if any + * Whether the principal can be inherited. + * @param {object} [resultDetails] + * Details of the selected result, if any. * @param {UrlbarUtils.RESULT_TYPE} [result.type] * Details of the result type, if any. * @param {UrlbarUtils.RESULT_SOURCE} [result.source] @@ -1230,7 +1230,7 @@ class UrlbarInput { url, openUILinkWhere, params, - result = {}, + resultDetails = null, browser = this.window.gBrowser.selectedBrowser ) { // No point in setting these because we'll handleRevert() a few rows below. @@ -1286,7 +1286,7 @@ class UrlbarInput { } // Notify about the start of navigation. - this._notifyStartNavigation(result); + this._notifyStartNavigation(resultDetails); try { this.window.openTrustedLinkIn(url, openUILinkWhere, params); @@ -1407,7 +1407,7 @@ class UrlbarInput { * if they aren't being used, e.g. WebNavigation. * * @param {UrlbarResult} result - * The result that was selected, if any. + * Details of the result that was selected, if any. */ _notifyStartNavigation(result) { Services.obs.notifyObservers({ result }, "urlbar-user-start-navigation");
1 0
0 0
[tor-browser/tor-browser-68.4.1esr-9.5-1] Revert "Bug 31764: Fix for error when navigating via 'Paste and go'"
by boklm@torproject.org 30 Jan '20

30 Jan '20
commit 45677fd3bc4fd9b69216bb25efadcbac3026672f Author: Nicolas Vigier <boklm(a)torproject.org> Date: Thu Jan 30 11:57:52 2020 +0100 Revert "Bug 31764: Fix for error when navigating via 'Paste and go'" This reverts commit 59d89229b68f8fbaa46e910a9bd03a6b26e8403e. With #32470 we backported Mozilla's fix for this issue. --- browser/components/urlbar/UrlbarInput.jsm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browser/components/urlbar/UrlbarInput.jsm b/browser/components/urlbar/UrlbarInput.jsm index 21a7a5d9910f..131d2ecc8ca8 100644 --- a/browser/components/urlbar/UrlbarInput.jsm +++ b/browser/components/urlbar/UrlbarInput.jsm @@ -443,7 +443,7 @@ class UrlbarInput { return; } - this._loadURL(url, where, openParams, null); + this._loadURL(url, where, openParams); } handleRevert() {
1 0
0 0
[tor-browser/tor-browser-68.4.1esr-9.5-1] fixup! TB4: Tor Browser's Firefox preference overrides.
by boklm@torproject.org 28 Jan '20

28 Jan '20
commit e8411693ccfa757557eecd97baaa8bb12a5c87dc Author: Nicolas Vigier <boklm(a)torproject.org> Date: Wed Jan 15 13:16:44 2020 +0100 fixup! TB4: Tor Browser's Firefox preference overrides. Bug 32948: Make referer behavior consistent regardless of private browing mode status --- browser/app/profile/000-tor-browser.js | 1 + 1 file changed, 1 insertion(+) diff --git a/browser/app/profile/000-tor-browser.js b/browser/app/profile/000-tor-browser.js index 1e054bf4a0c9..0176e8feb64d 100644 --- a/browser/app/profile/000-tor-browser.js +++ b/browser/app/profile/000-tor-browser.js @@ -137,6 +137,7 @@ pref("privacy.resistFingerprinting.letterboxing", true); // https://trac.torproject.org/projects/tor/ticket/27268#comment:19. We should // not leak that difference if possible. pref("dom.netinfo.enabled", false); +pref("network.http.referer.defaultPolicy", 2); // Bug 32948: Make referer behavior consistent regardless of private browing mode status // Third party stuff pref("privacy.firstparty.isolate", true); // Always enforce first party isolation
1 0
0 0
[tor-browser/tor-browser-68.4.1esr-9.5-1] fixup! Regression tests for TB4: Tor Browser's Firefox preference overrides.
by boklm@torproject.org 28 Jan '20

28 Jan '20
commit 77970cdee3ba6c294a7acfe9d9b5a2ae9511e579 Author: Georg Koppen <gk(a)torproject.org> Date: Wed Jan 8 15:30:20 2020 +0000 fixup! Regression tests for TB4: Tor Browser's Firefox preference overrides. --- tbb-tests/browser_tor_TB4.js | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/tbb-tests/browser_tor_TB4.js b/tbb-tests/browser_tor_TB4.js index c1f748a3338f..032386e22ae1 100644 --- a/tbb-tests/browser_tor_TB4.js +++ b/tbb-tests/browser_tor_TB4.js @@ -64,18 +64,7 @@ let expectedPrefs = [ ["browser.display.max_font_attempts",10], ["browser.display.max_font_count",10], ["gfx.downloadable_fonts.fallback_delay", -1], - ["general.appname.override", "Netscape"], - ["general.appversion.override", "5.0 (Windows)"], - ["general.oscpu.override", "Windows NT 6.1"], - ["general.platform.override", "Win32"], - ["general.useragent.override", "Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Firefox/24.0"], - ["general.productSub.override", "20100101"], - ["general.buildID.override", "20100101"], ["browser.startup.homepage_override.buildID", "20100101"], - ["general.useragent.vendor", ""], - ["general.useragent.vendorSub", ""], - ["dom.enable_performance", false], - ["browser.zoom.siteSpecific", false], // Third party stuff ["network.cookie.cookieBehavior", 1],
1 0
0 0
[tor-browser/tor-browser-68.4.1esr-9.5-1] fixup! TB4: Tor Browser's Firefox preference overrides.
by boklm@torproject.org 28 Jan '20

28 Jan '20
commit da7e8b35800a41249b5c2a847c4f931c4bf6582a Author: Georg Koppen <gk(a)torproject.org> Date: Thu Jan 9 10:13:29 2020 +0000 fixup! TB4: Tor Browser's Firefox preference overrides. Remaining clean-up done in #27268. --- browser/app/profile/000-tor-browser.js | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/browser/app/profile/000-tor-browser.js b/browser/app/profile/000-tor-browser.js index fb99eb6ed7d1..1e054bf4a0c9 100644 --- a/browser/app/profile/000-tor-browser.js +++ b/browser/app/profile/000-tor-browser.js @@ -114,34 +114,14 @@ pref("webgl.disable-extensions", true); pref("webgl.disable-fail-if-major-performance-caveat", true); pref("webgl.enable-webgl2", false); pref("gfx.downloadable_fonts.fallback_delay", -1); -pref("general.appname.override", "Netscape"); -pref("general.appversion.override", "5.0 (Windows)"); -pref("general.oscpu.override", "Windows NT 6.1"); -pref("general.platform.override", "Win32"); -pref("general.productSub.override", "20100101"); -pref("general.buildID.override", "20100101"); pref("browser.startup.homepage_override.buildID", "20100101"); -pref("general.useragent.vendor", ""); -pref("general.useragent.vendorSub", ""); -pref("dom.enable_performance", false); -pref("browser.zoom.siteSpecific", false); pref("browser.link.open_newwindow.restriction", 0); // Bug 9881: Open popups in new tabs (to avoid fullscreen popups) -pref("dom.gamepad.enabled", false); // bugs.torproject.org/13023 -// Disable video statistics fingerprinting vector (bug 15757) -pref("media.video_stats.enabled", false); // Set video VP9 to 0 for everyone (bug 22548) pref("media.benchmark.vp9.threshold", 0); -// Disable device sensors as possible fingerprinting vector (bug 15758) -pref("device.sensors.enabled", false); pref("dom.enable_resource_timing", false); // Bug 13024: To hell with this API pref("privacy.resistFingerprinting", true); pref("privacy.resistFingerprinting.block_mozAddonManager", true); // Bug 26114 -pref("privacy.suppressModifierKeyEvents", true); // Bug #17009: Suppress ALT and SHIFT events" -pref("ui.use_standins_for_native_colors", true); // https://bugzilla.mozilla.org/232227 -pref("privacy.use_utc_timezone", true); -pref("media.webspeech.synth.enabled", false); // Bug 10283: Disable SpeechSynthesis API pref("dom.webaudio.enabled", false); // Bug 13017: Disable Web Audio API -pref("dom.maxHardwareConcurrency", 1); // Bug 21675: Spoof single-core cpu pref("dom.w3c_touch_events.enabled", 0); // Bug 10286: Always disable Touch API pref("dom.w3c_pointer_events.enabled", false); pref("dom.vr.enabled", false); // Bug 21607: Disable WebVR for now @@ -152,6 +132,11 @@ pref("browser.cache.frecency_experiment", -1); pref("dom.use_components_shim", false); // Enable letterboxing pref("privacy.resistFingerprinting.letterboxing", true); +// Disable network information API everywhere. It gets spoofed in bug 1372072 +// but, alas, the behavior is inconsistent across platforms, see: +// https://trac.torproject.org/projects/tor/ticket/27268#comment:19. We should +// not leak that difference if possible. +pref("dom.netinfo.enabled", false); // Third party stuff pref("privacy.firstparty.isolate", true); // Always enforce first party isolation @@ -207,8 +192,7 @@ pref("media.eme.enabled", false); pref("media.mediadrm-widevinecdm.visible", false); // WebIDE can bypass proxy settings for remote debugging. It also downloads // some additional addons that we have not reviewed. Turn all that off. -pref("devtools.webide.autoinstallADBHelper", false); -pref("devtools.webide.autoinstallFxdtAdapters", false); +pref("devtools.webide.autoinstallADBExtension", false); pref("devtools.webide.enabled", false); // The in-browser debugger for debugging chrome code is not coping with our // restrictive DNS look-up policy. We use "127.0.0.1" instead of "localhost" as
1 0
0 0
[tor-browser/tor-browser-68.4.1esr-9.5-1] Bug 32414: Make Services.search.addEngine obey FPI
by boklm@torproject.org 28 Jan '20

28 Jan '20
commit 2197dad64e5c3752b1daeab0c676fda07880144c Author: Alex Catarineu <acat(a)torproject.org> Date: Fri Jan 10 17:54:18 2020 +0100 Bug 32414: Make Services.search.addEngine obey FPI --- browser/base/content/browser-pageActions.js | 70 ++++++++++++---------- mobile/android/chrome/content/browser.js | 15 ++++- .../processsingleton/MainProcessSingleton.jsm | 8 ++- toolkit/components/search/SearchEngine.jsm | 6 +- toolkit/components/search/SearchService.jsm | 5 +- toolkit/components/search/SearchUtils.jsm | 4 +- toolkit/components/search/nsISearchService.idl | 7 ++- 7 files changed, 74 insertions(+), 41 deletions(-) diff --git a/browser/base/content/browser-pageActions.js b/browser/base/content/browser-pageActions.js index 33680b2b4c1a..b2aefba866dd 100644 --- a/browser/base/content/browser-pageActions.js +++ b/browser/base/content/browser-pageActions.js @@ -1248,38 +1248,46 @@ BrowserPageActions.addSearchEngine = { }, _installEngine(uri, image) { - Services.search.addEngine(uri, image, false).then( - engine => { - showBrowserPageActionFeedback(this.action); - }, - errorCode => { - if (errorCode != Ci.nsISearchService.ERROR_DUPLICATE_ENGINE) { - // Download error is shown by the search service - return; + Services.search + .addEngine( + uri, + image, + false, + null, + gBrowser.selectedBrowser.contentPrincipal + ) + .then( + engine => { + showBrowserPageActionFeedback(this.action); + }, + errorCode => { + if (errorCode != Ci.nsISearchService.ERROR_DUPLICATE_ENGINE) { + // Download error is shown by the search service + return; + } + const kSearchBundleURI = + "chrome://global/locale/search/search.properties"; + let searchBundle = Services.strings.createBundle(kSearchBundleURI); + let brandBundle = document.getElementById("bundle_brand"); + let brandName = brandBundle.getString("brandShortName"); + let title = searchBundle.GetStringFromName( + "error_invalid_engine_title" + ); + let text = searchBundle.formatStringFromName( + "error_duplicate_engine_msg", + [brandName, uri], + 2 + ); + Services.prompt.QueryInterface(Ci.nsIPromptFactory); + let prompt = Services.prompt.getPrompt( + gBrowser.contentWindow, + Ci.nsIPrompt + ); + prompt.QueryInterface(Ci.nsIWritablePropertyBag2); + prompt.setPropertyAsBool("allowTabModal", true); + prompt.alert(title, text); } - const kSearchBundleURI = - "chrome://global/locale/search/search.properties"; - let searchBundle = Services.strings.createBundle(kSearchBundleURI); - let brandBundle = document.getElementById("bundle_brand"); - let brandName = brandBundle.getString("brandShortName"); - let title = searchBundle.GetStringFromName( - "error_invalid_engine_title" - ); - let text = searchBundle.formatStringFromName( - "error_duplicate_engine_msg", - [brandName, uri], - 2 - ); - Services.prompt.QueryInterface(Ci.nsIPromptFactory); - let prompt = Services.prompt.getPrompt( - gBrowser.contentWindow, - Ci.nsIPrompt - ); - prompt.QueryInterface(Ci.nsIWritablePropertyBag2); - prompt.setPropertyAsBool("allowTabModal", true); - prompt.alert(title, text); - } - ); + ); }, }; diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index 5f5ac123835c..cacf26587091 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -7253,7 +7253,10 @@ var SearchEngines = { return; } - this.addOpenSearchEngine(engines[data.button]); + this.addOpenSearchEngine( + engines[data.button], + browser.contentPrincipal + ); engines.splice(data.button, 1); if (engines.length < 1) { @@ -7269,9 +7272,15 @@ var SearchEngines = { }); }, - addOpenSearchEngine: async function addOpenSearchEngine(engine) { + addOpenSearchEngine: async function addOpenSearchEngine(engine, principal) { try { - await Services.search.addEngine(engine.url, engine.iconURL, false); + await Services.search.addEngine( + engine.url, + engine.iconURL, + false, + null, + principal + ); // Display a toast confirming addition of new search engine. Snackbars.show( Strings.browser.formatStringFromName( diff --git a/toolkit/components/processsingleton/MainProcessSingleton.jsm b/toolkit/components/processsingleton/MainProcessSingleton.jsm index 1e8caebd6ebc..69372bef1742 100644 --- a/toolkit/components/processsingleton/MainProcessSingleton.jsm +++ b/toolkit/components/processsingleton/MainProcessSingleton.jsm @@ -69,7 +69,13 @@ MainProcessSingleton.prototype = { } Services.search - .addEngine(engineURL.spec, iconURL ? iconURL.spec : null, true) + .addEngine( + engineURL.spec, + iconURL ? iconURL.spec : null, + true, + null, + browser.contentPrincipal + ) .catch(ex => Cu.reportError( "Unable to add search engine to the search service: " + ex diff --git a/toolkit/components/search/SearchEngine.jsm b/toolkit/components/search/SearchEngine.jsm index d84a3a23516c..c4b5b1ce556e 100644 --- a/toolkit/components/search/SearchEngine.jsm +++ b/toolkit/components/search/SearchEngine.jsm @@ -806,6 +806,8 @@ SearchEngine.prototype = { _iconUpdateURL: null, /* The extension ID if added by an extension. */ _extensionID: null, + /* The principal from which the engine was added. */ + _contentPrincipal: null, // Built in search engine extensions. _isBuiltin: false, @@ -851,7 +853,7 @@ SearchEngine.prototype = { '_initFromURIAndLoad: Downloading engine from: "' + loadURI.spec + '".' ); - var chan = SearchUtils.makeChannel(loadURI); + var chan = SearchUtils.makeChannel(loadURI, this._contentPrincipal); if (this._engineToUpdate && chan instanceof Ci.nsIHttpChannel) { var lastModified = this._engineToUpdate.getAttr("updatelastmodified"); @@ -1231,7 +1233,7 @@ SearchEngine.prototype = { this.name + '"' ); - var chan = SearchUtils.makeChannel(uri); + var chan = SearchUtils.makeChannel(uri, this._contentPrincipal); let iconLoadCallback = function(byteArray, engine) { // This callback may run after we've already set a preferred icon, diff --git a/toolkit/components/search/SearchService.jsm b/toolkit/components/search/SearchService.jsm index e869be458c7d..772edada7bfd 100644 --- a/toolkit/components/search/SearchService.jsm +++ b/toolkit/components/search/SearchService.jsm @@ -2311,7 +2311,7 @@ SearchService.prototype = { return this.addEngineWithDetails(params.name, params, isReload); }, - async addEngine(engineURL, iconURL, confirm, extensionID) { + async addEngine(engineURL, iconURL, confirm, extensionID, contentPrincipal) { SearchUtils.log('addEngine: Adding "' + engineURL + '".'); await this.init(true); let errCode; @@ -2325,6 +2325,9 @@ SearchService.prototype = { if (extensionID) { engine._extensionID = extensionID; } + if (contentPrincipal) { + engine._contentPrincipal = contentPrincipal; + } errCode = await new Promise(resolve => { engine._installCallback = function(errorCode) { resolve(errorCode); diff --git a/toolkit/components/search/SearchUtils.jsm b/toolkit/components/search/SearchUtils.jsm index f9550307e875..8b630afbdd6e 100644 --- a/toolkit/components/search/SearchUtils.jsm +++ b/toolkit/components/search/SearchUtils.jsm @@ -133,13 +133,13 @@ var SearchUtils = { * The URL string from which to create an nsIChannel. * @returns an nsIChannel object, or null if the url is invalid. */ - makeChannel(url) { + makeChannel(url, principal) { try { let uri = typeof url == "string" ? Services.io.newURI(url) : url; return Services.io.newChannelFromURI( uri, null /* loadingNode */, - Services.scriptSecurityManager.getSystemPrincipal(), + principal || Services.scriptSecurityManager.getSystemPrincipal(), null /* triggeringPrincipal */, Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL, Ci.nsIContentPolicy.TYPE_OTHER diff --git a/toolkit/components/search/nsISearchService.idl b/toolkit/components/search/nsISearchService.idl index 2e085985a976..4a8f4015fb28 100644 --- a/toolkit/components/search/nsISearchService.idl +++ b/toolkit/components/search/nsISearchService.idl @@ -3,6 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "nsISupports.idl" +#include "nsIPrincipal.idl" interface nsIURI; interface nsIInputStream; @@ -288,11 +289,15 @@ interface nsISearchService : nsISupports * @param extensionID [optional] * Optional: The correct extensionID if called by an add-on. * + * @param principal [optional] + * Optional: The principal from which the search engine was added. + * * @throws NS_ERROR_FAILURE if the description file cannot be successfully * loaded. */ Promise addEngine(in AString engineURL, in AString iconURL, in boolean confirm, - [optional] in AString extensionID); + [optional] in AString extensionID, + [optional] in nsIPrincipal principal); /** * Adds a new search engine, without asking the user for confirmation and
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 1485
  • 1486
  • 1487
  • 1488
  • 1489
  • 1490
  • 1491
  • ...
  • 2043
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.