Skip to content

Commit

Permalink
Attempt to disconnect mutationObserver
Browse files Browse the repository at this point in the history
  • Loading branch information
edlea committed Oct 21, 2015
1 parent a0a3550 commit 8a7dd0d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion amp.safariextension/amp.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ var observer = new MutationObserver(function(mutations) {
style.appendChild(document.createTextNode(css));
node.appendChild(style);
}
else if (node.tagName == "BODY") {
observer.disconnect();
}
}
});
});

var config = { attributes: true, childList: true, subtree: true };
var config = { childList: true, subtree: true };
observer.observe(document.documentElement, config);
5 changes: 4 additions & 1 deletion chrome/amp.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ var observer = new MutationObserver(function(mutations) {
style.appendChild(document.createTextNode(css));
node.appendChild(style);
}
else if (node.tagName == "BODY") {
observer.disconnect();
}
}
});
});

var config = { attributes: true, childList: true, subtree: true };
var config = { childList: true, subtree: true };
observer.observe(document.documentElement, config);

0 comments on commit 8a7dd0d

Please sign in to comment.