countStylesInHash when skipping styleReplaceAll
This commit is contained in:
parent
e45748d515
commit
2fe4c0793c
|
@ -316,6 +316,7 @@
|
|||
function replaceAll(newStyles) {
|
||||
if ('disableAll' in newStyles &&
|
||||
disableAll === newStyles.disableAll &&
|
||||
styleElements.size === countStylesInHash(newStyles) &&
|
||||
[...styleElements.values()].every(el =>
|
||||
el.disabled === disableAll &&
|
||||
el.parentNode === ROOT &&
|
||||
|
@ -340,6 +341,14 @@
|
|||
}
|
||||
|
||||
|
||||
function countStylesInHash(styleHash) {
|
||||
let num = 0;
|
||||
for (const k in styleHash) {
|
||||
num += !isNaN(parseInt(k)) ? 1 : 0;
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
function orphanCheck() {
|
||||
if (chrome.i18n && chrome.i18n.getUILanguage()) {
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue
Block a user