Skip to content
Snippets Groups Projects
Verified Commit 18f88e69 authored by henry's avatar henry Committed by Pier Angelo Vendrame
Browse files

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.
parent 585da35e
Branches
Tags
1 merge request!815Rebased onto Firefox 115.3.1esr
......@@ -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")
......
......@@ -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";
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment