From 3e8ae43a5bbd485d4343ac7975a65b894671996c Mon Sep 17 00:00:00 2001 From: Cameron Kaiser Date: Thu, 11 Mar 2021 22:32:27 -0800 Subject: [PATCH] #636: fix double redirects with fragments; add more locale --- browser/base/content/tab-content.js | 7 +++++-- browser/locales/en-US/chrome/browser/TenFourFox.properties | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/browser/base/content/tab-content.js b/browser/base/content/tab-content.js index be431a59b..faade1aed 100644 --- a/browser/base/content/tab-content.js +++ b/browser/base/content/tab-content.js @@ -317,6 +317,7 @@ var AboutReaderListener = { if (this._currentURISpec == loc.href) return; this._currentURISpec = loc.href; + /* process into an nsIURI. this gives us a reliable host *and* spec w/o ref */ let uri = Services.io.newURI(loc.href, null, null); if (uri && uri.host && uri.host.length && uri.host.length > 0) { let w = null; @@ -325,7 +326,8 @@ var AboutReaderListener = { } catch(e) { } if (w && w.length && w.length > 0) { if (w == "y") { - loc.href = "about:reader?url="+encodeURIComponent(uri.spec); + this._currentURISpec = uri.specIgnoringRef; // might change + loc.replace("about:reader?url="+encodeURIComponent(uri.specIgnoringRef)); return; } if (w == "s") { @@ -333,7 +335,8 @@ var AboutReaderListener = { && !uri.path.startsWith("/?") && !uri.path.toLowerCase().startsWith("/index.") ) { - loc.href = "about:reader?url="+encodeURIComponent(uri.spec); + this._currentURISpec = uri.specIgnoringRef; // might change + loc.replace("about:reader?url="+encodeURIComponent(uri.specIgnoringRef)); return; } } diff --git a/browser/locales/en-US/chrome/browser/TenFourFox.properties b/browser/locales/en-US/chrome/browser/TenFourFox.properties index f6cfa6fd7..10269227c 100644 --- a/browser/locales/en-US/chrome/browser/TenFourFox.properties +++ b/browser/locales/en-US/chrome/browser/TenFourFox.properties @@ -15,3 +15,5 @@ TFFmseMode.prompt.p = Enable MSE/media quality options (slower, if available) TFFsiteSpecificUAs.title = Site Specific User Agents TFFsiteSpecificUAs.prompt = This is for advanced users to use a custom user agent for particular domains automatically. Enter a domain and a user agent string, or select a predefined one. +TFFautoReaderView.title = Site Specific Auto Reader View +TFFautoReaderView.prompt = Enter domain names that will automatically switch to the simpler Reader View for all pages, or for subpages only.