Commit 10569989 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame 🎃
Browse files

TB 40458: Implement .tor.onion aliases

We have enabled HTTPS-Only mode, therefore we do not need
HTTPS-Everywhere anymore.
However, we want to keep supporting .tor.onion aliases (especially for
securedrop).
Therefore, in this patch we implemented the parsing of HTTPS-Everywhere
rulesets, and the redirect of .tor.onion domains.
Actually, Tor Browser believes they are actual domains. We change them
on the fly on the SOCKS proxy requests to resolve the domain, and on
the code that verifies HTTPS certificates.
parent b6d63fb2
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -143,3 +143,5 @@ pref("browser.torcircuitpanel.loglevel", "Log");
pref("browser.tor_android.log_level", "Info");
pref("browser.dragdropfilter.log_level", "Warn");
pref("browser.onionAuthPrompt.loglevel", "Warn");
pref("browser.onionalias.log_level", "Warn");
pref("browser.torRequestWatch.log_level", "Warn");
+2 −0
Original line number Diff line number Diff line
@@ -89,6 +89,7 @@ category browser-first-window-ready moz-src:///browser/modules/ClipboardPrivacy.
category browser-first-window-ready moz-src:///browser/modules/SecurityLevelNotification.sys.mjs SecurityLevelNotification.ready
category browser-first-window-ready moz-src:///toolkit/modules/DragDropFilter.sys.mjs DragDropFilter.init
category browser-first-window-ready moz-src:///browser/modules/TorSettingsNotification.sys.mjs TorSettingsNotification.ready
category browser-first-window-ready moz-src:///browser/components/onionservices/OnionAliasStore.sys.mjs OnionAliasStore.init

category browser-idle-startup moz-src:///browser/components/places/PlacesUIUtils.sys.mjs PlacesUIUtils.unblockToolbars
category browser-idle-startup resource:///modules/BuiltInThemes.sys.mjs BuiltInThemes.ensureBuiltInThemes
@@ -136,5 +137,6 @@ category browser-quit-application-granted resource://gre/modules/UpdateListener.
#endif
category browser-quit-application-granted moz-src:///browser/components/urlbar/UrlbarSearchTermsPersistence.sys.mjs UrlbarSearchTermsPersistence.uninit
category browser-quit-application-granted moz-src:///browser/components/ipprotection/IPProtectionHelpers.sys.mjs IPProtectionActivator.uninit
category browser-quit-application-granted moz-src:///browser/components/onionservices/OnionAliasStore.sys.mjs OnionAliasStore.uninit

category browser-newtab-external-component moz-src:///browser/components/search/SearchUIUtils.sys.mjs SearchNewTabComponentsRegistrant
+13 −0
Original line number Diff line number Diff line
@@ -726,6 +726,19 @@ let JSWINDOWACTORS = {
    enablePreference: "accessibility.blockautorefresh",
  },

  Rulesets: {
    parent: {
      esModuleURI: "resource:///modules/RulesetsParent.sys.mjs",
    },
    child: {
      esModuleURI: "resource:///modules/RulesetsChild.sys.mjs",
      events: {
        DOMWindowCreated: {},
      },
    },
    matches: ["about:rulesets*"],
  },

  ScreenshotsComponent: {
    parent: {
      esModuleURI:
+5 −0
Original line number Diff line number Diff line
@@ -112,6 +112,11 @@ static const RedirEntry kRedirMap[] = {
     nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
         nsIAboutModule::ALLOW_SCRIPT},
#endif
    {"rulesets", "chrome://browser/content/rulesets/aboutRulesets.html",
     nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::URI_MUST_LOAD_IN_CHILD |
         nsIAboutModule::URI_CAN_LOAD_IN_PRIVILEGEDABOUT_PROCESS |
         nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
         nsIAboutModule::IS_SECURE_CHROME_UI},
    {"sessionrestore", "chrome://browser/content/aboutSessionRestore.xhtml",
     nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::HIDE_FROM_ABOUTABOUT |
         nsIAboutModule::IS_SECURE_CHROME_UI},
+1 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ pages = [
    'restartrequired',
    # Removed 'rights'. tor-browser#43901.
    # Removed 'robots'. tor-browser#42831.
    'rulesets',
    'sessionrestore',
    'settings',
    'tabcrashed',
Loading