From d39cf6a1125c4103bd98e0c26c04233317c4ec63 Mon Sep 17 00:00:00 2001 From: JustOff Date: Tue, 21 Aug 2018 18:32:45 +0300 Subject: Update ShouldAddToSessionHistory() rules for "about:newtab" and "about:logopage" --- docshell/base/nsDocShell.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 8eca47495..21234b896 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -12281,7 +12281,11 @@ nsDocShell::ShouldAddToSessionHistory(nsIURI* aURI) return false; } - if (buf.EqualsLiteral("blank") || buf.EqualsLiteral("newtab")) { + if (buf.EqualsLiteral("blank") || buf.EqualsLiteral("logopage") +#ifndef MC_PALEMOON + || buf.EqualsLiteral("newtab") +#endif + ) { return false; } } -- cgit v1.2.3 From de50d15d2800e947fb800a9a318969cebddceb67 Mon Sep 17 00:00:00 2001 From: JustOff Date: Wed, 22 Aug 2018 13:40:19 +0300 Subject: Use "browser.newtabpage.add_to_session_history" to decide whether to store "about:newtab" in the session history --- docshell/base/nsDocShell.cpp | 8 +++----- modules/libpref/init/all.js | 4 ++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 21234b896..a3d42c679 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -12281,11 +12281,9 @@ nsDocShell::ShouldAddToSessionHistory(nsIURI* aURI) return false; } - if (buf.EqualsLiteral("blank") || buf.EqualsLiteral("logopage") -#ifndef MC_PALEMOON - || buf.EqualsLiteral("newtab") -#endif - ) { + if (buf.EqualsLiteral("blank") || buf.EqualsLiteral("logopage") || + buf.EqualsLiteral("newtab") && + !Preferences::GetBool("browser.newtabpage.add_to_session_history", false)) { return false; } } diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index 6eddfe7a2..1a67293e4 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -247,6 +247,10 @@ pref("dom.compartment_per_addon", true); // of content viewers to cache based on the amount of available memory. pref("browser.sessionhistory.max_total_viewers", -1); +// Whether to store 'about:newtab' in the session history, disabled by default. +// See https://github.com/MoonchildProductions/UXP/issues/719 +pref("browser.newtabpage.add_to_session_history", false); + pref("ui.use_native_colors", true); pref("ui.click_hold_context_menus", false); // Duration of timeout of incremental search in menus (ms). 0 means infinite. -- cgit v1.2.3 From c6498fe688515413144376dc59b728905c72b34e Mon Sep 17 00:00:00 2001 From: JustOff Date: Wed, 22 Aug 2018 14:08:55 +0300 Subject: Explicitly specify parentheses in a mixed boolean expression in ShouldAddToSessionHistory() --- docshell/base/nsDocShell.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index a3d42c679..f4840297d 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -12282,8 +12282,8 @@ nsDocShell::ShouldAddToSessionHistory(nsIURI* aURI) } if (buf.EqualsLiteral("blank") || buf.EqualsLiteral("logopage") || - buf.EqualsLiteral("newtab") && - !Preferences::GetBool("browser.newtabpage.add_to_session_history", false)) { + (buf.EqualsLiteral("newtab") && + !Preferences::GetBool("browser.newtabpage.add_to_session_history", false))) { return false; } } -- cgit v1.2.3