Show me the code! – By Davanum Srinivas

September 3, 2008

[ubiquity] Block pesky browser plugins (flash etc)

Filed under: Uncategorized — Davanum Srinivas @ 1:06 pm

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); } } }); [/sourcecode]

1 Comment »

  1. 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


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: