countStylesInHash when skipping styleReplaceAll
This commit is contained in:
parent
e45748d515
commit
2fe4c0793c
|
@ -316,6 +316,7 @@
|
||||||
function replaceAll(newStyles) {
|
function replaceAll(newStyles) {
|
||||||
if ('disableAll' in newStyles &&
|
if ('disableAll' in newStyles &&
|
||||||
disableAll === newStyles.disableAll &&
|
disableAll === newStyles.disableAll &&
|
||||||
|
styleElements.size === countStylesInHash(newStyles) &&
|
||||||
[...styleElements.values()].every(el =>
|
[...styleElements.values()].every(el =>
|
||||||
el.disabled === disableAll &&
|
el.disabled === disableAll &&
|
||||||
el.parentNode === ROOT &&
|
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() {
|
function orphanCheck() {
|
||||||
if (chrome.i18n && chrome.i18n.getUILanguage()) {
|
if (chrome.i18n && chrome.i18n.getUILanguage()) {
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user