Merge pull request #8 from interactivefics/mutation-observer-bug

Fix bug with comment boxes in Chrome
This commit is contained in:
Mariam Maarouf 2020-10-04 13:50:47 +02:00 committed by GitHub
commit f0f0ecd1a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 17 deletions

View File

@ -74,23 +74,25 @@ const replaceText = (textNode, input_word, replace_value) => {
function walk(node, v, p){ function walk(node, v, p){
// I stole this function from here: // I stole the base to this function from here:
// http://is.gd/mwZp7E // http://is.gd/mwZp7E
var child, next; if (node.contentEditable != 'true' && node.type != 'textarea' && node.type != 'input') {
switch (node.nodeType){ var child, next;
case 1: // Element switch (node.nodeType){
case 9: // Document case 1: // Element
case 11: // Document fragment case 9: // Document
child = node.firstChild; case 11: // Document fragment
while (child){ child = node.firstChild;
next = child.nextSibling; while (child){
walk(child, v, p); next = child.nextSibling;
child = next; walk(child, v, p);
} child = next;
break; }
case 3: // Text node break;
replaceText(node, v, p); case 3: // Text node
break; replaceText(node, v, p);
break;
}
} }
} }

View File

@ -3,7 +3,7 @@
"manifest_version": 2, "manifest_version": 2,
"name": "InteractiveFics", "name": "InteractiveFics",
"author": "mariamrf", "author": "mariamrf",
"version": "5.1.0", "version": "5.1.1",
"description": "Replaces Y/N & other variables in Reader Insert/second person fics with words of your choice.", "description": "Replaces Y/N & other variables in Reader Insert/second person fics with words of your choice.",
"browser_action": { "browser_action": {
"default_title": "InteractiveFics", "default_title": "InteractiveFics",