fixup for Chrome 49 without Symbol.iterator
This commit is contained in:
parent
e61a24b4e4
commit
aaa50d6b7b
7
apply.js
7
apply.js
|
@ -261,9 +261,10 @@ function initDocRewriteObserver() {
|
||||||
};
|
};
|
||||||
// detect documentElement being rewritten from inside the script
|
// detect documentElement being rewritten from inside the script
|
||||||
docRewriteObserver = new MutationObserver(mutations => {
|
docRewriteObserver = new MutationObserver(mutations => {
|
||||||
for (const mutation of mutations) {
|
for (let m = mutations.length; --m >= 0;) {
|
||||||
for (const node of mutation.addedNodes) {
|
const added = mutations[m].addedNodes;
|
||||||
if (node.localName == 'html') {
|
for (let n = added.length; --n >= 0;) {
|
||||||
|
if (added[n].localName == 'html') {
|
||||||
reinjectStyles();
|
reinjectStyles();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
11
install.js
11
install.js
|
@ -143,14 +143,17 @@ function getResource(url) {
|
||||||
|
|
||||||
function rebrand(mutations) {
|
function rebrand(mutations) {
|
||||||
/* stylish to stylus; https://github.com/schomery/stylish-chrome/issues/12 */
|
/* stylish to stylus; https://github.com/schomery/stylish-chrome/issues/12 */
|
||||||
for (const mutation of mutations) {
|
for (let m = mutations.length; --m >= 0;) {
|
||||||
for (const addedNode of mutation.addedNodes) {
|
const added = mutations[m].addedNodes;
|
||||||
|
for (let n = added.length; --n >= 0;) {
|
||||||
|
const addedNode = added[n];
|
||||||
if (addedNode.nodeType != Node.ELEMENT_NODE) {
|
if (addedNode.nodeType != Node.ELEMENT_NODE) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const elementsToCheck = addedNode.matches('.install-status') ? [addedNode]
|
const elementsToCheck = addedNode.matches('.install-status') ? [addedNode]
|
||||||
: Array.prototype.slice.call(addedNode.getElementsByClassName('install-status'));
|
: addedNode.getElementsByClassName('install-status');
|
||||||
for (const el of elementsToCheck) {
|
for (let i = elementsToCheck.length; --i >= 0;) {
|
||||||
|
const el = elementsToCheck[i];
|
||||||
if (!el.textContent.includes('Stylish')) {
|
if (!el.textContent.includes('Stylish')) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user