mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-10 10:18:38 +09:00
Replace explicit pref observer with lazy preference getters. Tag #361.
This commit is contained in:
parent
85caaf571c
commit
14aede3cc5
2 changed files with 11 additions and 33 deletions
|
|
@ -38,15 +38,6 @@ this.ReaderMode = {
|
|||
|
||||
DEBUG: 0,
|
||||
|
||||
// Don't try to parse the page if it has too many elements (for memory and
|
||||
// performance reasons)
|
||||
get maxElemsToParse() {
|
||||
delete this.parseNodeLimit;
|
||||
|
||||
Services.prefs.addObserver("reader.parse-node-limit", this, false);
|
||||
return this.parseNodeLimit = Services.prefs.getIntPref("reader.parse-node-limit");
|
||||
},
|
||||
|
||||
/**
|
||||
* Enter the reader mode by going forward one step in history if applicable,
|
||||
* if not, append the about:reader page in the history instead.
|
||||
|
|
@ -548,3 +539,8 @@ this.ReaderMode = {
|
|||
return readingSpeed.get(lang) || readingSpeed.get("en");
|
||||
},
|
||||
};
|
||||
|
||||
// Don't try to parse the page if it has too many elements (for memory and
|
||||
// performance reasons)
|
||||
XPCOMUtils.defineLazyPreferenceGetter(
|
||||
ReaderMode, "maxElemsToParse", "reader.parse-node-limit", 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue