Skip to content

Instantly share code, notes, and snippets.

@tbassetto
Created September 18, 2010 01:23
Show Gist options
  • Save tbassetto/585232 to your computer and use it in GitHub Desktop.
Save tbassetto/585232 to your computer and use it in GitHub Desktop.
var pageMod = require("page-mod");
pageMod.add(new pageMod.PageMod({
include: "*",
contentScriptWhen: 'start',
contentScript: 'new ' + function WorkerScope() {
console.log("exec");
var htmlMutation = function(e) {
var node = document.querySelector('object, embed');
console.log("node = ", node);
if (node) {
node.parentNode.removeChild(node);
}
};
var documentMutation = document.addEventListener('DOMNodeInserted', function() {
if (htmlMutation) {
document.addEventListener('DOMSubtreeModified', htmlMutation, false);
htmlMutation = null;
}
document.removeEventListener(documentMutation);
}, false);
}
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment