check typeof node in MutationObserver

This commit is contained in:
Ilya Grigorik
2016-06-09 18:22:53 -04:00
parent b0547496c9
commit a2055f9d3e

View File

@@ -180,7 +180,10 @@ chrome.extension.sendMessage({}, function(response) {
}
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
forEach.call(mutation.addedNodes, function(node) {
mutation.addedNodes.forEach(node => {
if (typeof node === "function")
return;
checkForVideo(node, node.parentNode || mutation.target);
})
});