Remove Images From Any Site

By dkhal Last update Oct 3, 2008 — Installed 858 times.

Archived Comments (locked)

in
Subscribe to Archived Comments 15 posts, 6 voices



Jesse Andrews Admin

The following is an archive of comments made before threaded discussions was implemented (November 16th, 2008)

 
JoeSimmons Scriptwright

 
dkhal Script's Author

yes i used yours and added //Thanks to JoeSimmons coz i noticed too

 
JoeSimmons Scriptwright

but hiding the images doesn't increase load time.

 
dkhal Script's Author

good then this is better

 
Avindra V.G. Scriptwright

also, I'm not sure if this would be as effective, but you can technically just insert the CSS rule:

img {display:none!important}

 
JoeSimmons Scriptwright

var di=document.images;
for(var i=0;i<di.length;i++) {di[i].parentNode.removeChild(di[i]);}

 
dkhal Script's Author

thanks for the tip
i appreciate it very much

 
Avindra V.G. Scriptwright

I say do:

// ==UserScript==
// @name           Remove Images From Any Site
// @namespace      ~dkhal~
// @copyright      dkhal
// ==/UserScript==
for(i=0;i<document.images.length;i++) document.images[i].src=""

since the document.images already exists, you should use it instead of re-evaluating all the images.

 
M0rph3u5 User

looks interesting ima try

 
dkhal Script's Author

thanks

 
JoeSimmons Scriptwright

Should re-write it like this...

n = document.evaluate("//img", document, null, 6, null);
for(i=0; i<n.snapshotLength; i++){
n.snapshotItem(i).src="";
}

 
dkhal Script's Author

fixed it
the other 2 were just in case the site blocked the first method

 
atearwhofellnot User

This script is inefficient as hell. It calls getElementsByTagName() three times for every image on the page although only one call is necessary.

 
dkhal Script's Author

If you have any script requests please post them here or send them to me by email.
This removes all images for better browsing.

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel