Inspired by the greasemonkey script here.
CmdUtils.CreateCommand({
name: "block-plugins",
execute: function(input) {
var document = context.focusedWindow.document;
e = document.evaluate("//embed", document, null, 6, null);
for (i = 0; i < e.snapshotLength; i++) {
var object = e.snapshotItem(i);
object.parentNode.removeChild(object);
}
e = document.evaluate("//object", document, null, 6, null);
for (i = 0; i < e.snapshotLength; i++) {
var object = e.snapshotItem(i);
object.parentNode.removeChild(object);
}
}
});
Couldn’t you replace the document.evaluate() calls with jquery $(//embed) call since ubiquity already requires JQuery
Comment by Shakeel Mahate — September 5, 2008 @ 10:50 am