mirror of
https://github.com/SoPat712/videospeed.git
synced 2025-10-30 02:30:35 -04:00
check typeof node in MutationObserver
This commit is contained in:
@@ -180,7 +180,10 @@ chrome.extension.sendMessage({}, function(response) {
|
|||||||
}
|
}
|
||||||
var observer = new MutationObserver(function(mutations) {
|
var observer = new MutationObserver(function(mutations) {
|
||||||
mutations.forEach(function(mutation) {
|
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);
|
checkForVideo(node, node.parentNode || mutation.target);
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user