#636: fix double redirects with fragments; add more locale

This commit is contained in:
Cameron Kaiser 2021-03-11 22:32:27 -08:00
parent 355d707412
commit 3e8ae43a5b
2 changed files with 7 additions and 2 deletions

View File

@ -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;
}
}

View File

@ -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.