mirror of
https://github.com/classilla/tenfourfox.git
synced 2025-02-06 02:30:56 +00:00
#583: always-on (mostly) reader mode
This commit is contained in:
parent
638361bd88
commit
cb5d8f86a7
@ -11,6 +11,9 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/ExtensionContent.jsm");
|
||||
|
||||
const g104FxForcePref = "tenfourfox.reader.force-enable"; // TenFourFox issue 583
|
||||
Cu.import("resource://gre/modules/Preferences.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "E10SUtils",
|
||||
"resource:///modules/E10SUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "BrowserUtils",
|
||||
@ -254,6 +257,7 @@ AboutPrivateBrowsingListener.init(this);
|
||||
var AboutReaderListener = {
|
||||
|
||||
_articlePromise: null,
|
||||
_alwaysAllowReaderMode: true, // TenFourFox issue 583
|
||||
|
||||
init: function() {
|
||||
addEventListener("AboutReaderContentLoaded", this, false, true);
|
||||
@ -262,6 +266,17 @@ var AboutReaderListener = {
|
||||
addEventListener("pagehide", this, false);
|
||||
addMessageListener("Reader:ParseDocument", this);
|
||||
addMessageListener("Reader:PushState", this);
|
||||
Services.prefs.addObserver(g104FxForcePref, this, false);
|
||||
},
|
||||
|
||||
// TenFourFox issue 583
|
||||
uninit: function() {
|
||||
Services.prefs.removeObserver(g104FxForcePref, this, false);
|
||||
},
|
||||
observe: function(subject, topic, data) { // jshint ignore:line
|
||||
if (topic === "nsPref:changed") {
|
||||
this._alwaysAllowReaderMode = Preferences.get(g104FxForcePref, true);
|
||||
}
|
||||
},
|
||||
|
||||
receiveMessage: function(message) {
|
||||
@ -357,6 +372,17 @@ var AboutReaderListener = {
|
||||
|
||||
onPaintWhenWaitedFor: function(forceNonArticle) {
|
||||
this.cancelPotentialPendingReadabilityCheck();
|
||||
|
||||
// TenFourFox issue 583
|
||||
// If we are always allowing reader mode, don't bother spending any time
|
||||
// processing the page. But don't let just everything through.
|
||||
if (!this.isAboutReader) {
|
||||
if (this._alwaysAllowReaderMode && !(content.document.documentURI.startsWith("about:"))) {
|
||||
sendAsyncMessage("Reader:UpdateReaderButton", { isArticle: true });
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Only send updates when there are articles; there's no point updating with
|
||||
// |false| all the time.
|
||||
if (ReaderMode.isProbablyReaderable(content.document)) {
|
||||
|
@ -1041,9 +1041,6 @@ pref("dom.disable_window_open_feature.status", true);
|
||||
|
||||
pref("dom.allow_scripts_to_close_windows", false);
|
||||
|
||||
// TenFourFox issue 463
|
||||
pref("tenfourfox.dom.requestIdleCallback.enabled", false);
|
||||
|
||||
pref("dom.require_user_interaction_for_beforeunload", true);
|
||||
|
||||
pref("dom.disable_open_during_load", false);
|
||||
@ -5159,7 +5156,13 @@ pref("toolkit.pageThumbs.minHeight", 0);
|
||||
// when the page is reloaded. To turn this feature off, just set the limit to 0.
|
||||
pref("prompts.authentication_dialog_abuse_limit", 3);
|
||||
|
||||
// TenFourFox issue 463
|
||||
pref("tenfourfox.dom.requestIdleCallback.enabled", false);
|
||||
|
||||
pref("tenfourfox.adblock.enabled", false);
|
||||
pref("tenfourfox.adblock.logging.enabled", false);
|
||||
pref("tenfourfox.dom.forms.date", true);
|
||||
pref("tenfourfox.dom.forms.time", true);
|
||||
|
||||
// TenFourFox issue 583
|
||||
pref("tenfourfox.reader.force-enable", true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user