Pier Angelo Vendrame pushed to branch tor-browser-115.3.0esr-13.0-1 at The Tor Project / Applications / Tor Browser
Commits: 115d43a5 by Henry Wilkes at 2023-10-04T14:16:14+00:00 fixup! Bug 7494: Create local home page for TBB.
Bug 41717: Show the bookmarks toolbar on "about:tor" pages as well.
Also an implementation note to AboutNewTabService.
- - - - -
2 changed files:
- browser/base/content/browser-places.js - browser/components/newtab/AboutNewTabService.jsm
Changes:
===================================== browser/base/content/browser-places.js ===================================== @@ -1419,6 +1419,14 @@ var BookmarkingUI = { },
isOnNewTabPage({ currentURI }) { + // If uri is "about:tor" then we return true. See tor-browser#41717. + // NOTE: "about:newtab", "about:welcome", "about:home" and + // "about:privatebrowsing" can also redirect to "about:tor". + // NOTE: We do not simply add "about:tor" to newTabURLs below because this + // would also match "about:torconnect". + if (currentURI?.scheme === "about" && currentURI?.filePath === "tor") { + return true; + } // Prevent loading AboutNewTab.jsm during startup path if it // is only the newTabURL getter we are interested in. let newTabURL = Cu.isModuleLoaded("resource:///modules/AboutNewTab.jsm")
===================================== browser/components/newtab/AboutNewTabService.jsm ===================================== @@ -430,6 +430,18 @@ class BaseAboutNewTabService { * the newtab page has no effect on the result of this function. */ get defaultURL() { + // NOTE: We return "about:tor" rather than the "chrome:" path + // "chrome://browser/content/abouttor/aboutTor.html" + // The result is that the channel created in NewChannel in + // browser/components/about/AboutRedirector.cpp will have its + // resultPrincipalURI set to "about:tor". + // What this means in practice is that the loaded document's documentURI and + // currentURI will be "about:tor" rather than "about:newtab", "about:home", + // "about:welcome" or "about:privatebrowsing". + // The disadvantage of this is that we often need to add "about:tor" to + // places where "about:newtab" or other URIs appear. + // The advantage is that we maintain more control against changes in + // mozilla-central. return "about:tor"; }
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/115d43a5...