Skip to content
Snippets Groups Projects
Verified Commit c3637be5 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame :jack_o_lantern:
Browse files

fixup! Bug 27476: Implement about:torconnect captive portal within Tor Browser

Moved the logic of the about:tor redirects before the bootstrap
parent 4fa75c0e
1 merge request!694Bug 41796: Rebased on top of FIREFOX_ESR_115_BASE
......@@ -418,6 +418,28 @@ export const URILoadingHelper = {
return;
}
// make sure users are not faced with the scary red 'tor isn't working' screen
// if they navigate to about:tor before bootstrapped
//
// fixes tor-browser#40752
// new tabs also redirect to about:tor if browser.newtabpage.enabled is true
// otherwise they go to about:blank
if (lazy.TorConnect.shouldShowTorConnect) {
const homeURLs = [
"about:home",
"about:privatebrowsing",
"about:tor",
"about:welcome",
];
if (
homeURLs.includes(url) ||
(url === "about:newtab" &&
Services.prefs.getBoolPref("browser.newtabpage.enabled", false))
) {
url = lazy.TorConnect.getRedirectURL(url);
}
}
let {
allowThirdPartyFixup,
postData,
......@@ -673,22 +695,6 @@ export const URILoadingHelper = {
) {
event = BrowserUtils.getRootEvent(event);
// make sure users are not faced with the scary red 'tor isn't working' screen
// if they navigate to about:tor before bootstrapped
//
// fixes tor-browser#40752
// new tabs also redirect to about:tor if browser.newtabpage.enabled is true
// otherwise they go to about:blank
if (lazy.TorConnect.shouldShowTorConnect) {
if (
url === "about:tor" ||
(url === "about:newtab" &&
Services.prefs.getBoolPref("browser.newtabpage.enabled", false))
) {
url = lazy.TorConnect.getRedirectURL(url);
}
}
let params;
if (aIgnoreButton && typeof aIgnoreButton == "object") {
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment