Forum Moderators: open
Here is some (poor) bookmarklet script:
javascript:a=document.getElementsByTagName('iframe');
b=document.getElementsByTagName('EMBED');
c=document.getElementsByTagName('img');
for(n=0;n<a.length;n++){i=a[n];
if(i.width!=0&&i.height!=0)i.style.visibility='hidden'};
for(n=0;n<b.length;n++){i=b[n];
if(i.width!=0&&i.height!=0)i.style.visibility='hidden'};
for(n=0;n<c.length;n++){i=c[n];
if(i.width!=0&&i.height!=0)i.style.visibility='hidden';}void 0;
Currently the above bookmarklet hides iframes, flash objects, and all images - leaving you with a nice clean Zenlike browser with undiluted content. (based off a more elegant script from O'Reilly's JavaScript The Definitive Guide (a great book)).
Instead of removing all of the images, I would just like to disable the API's that control Flash execution and .gif animation - if possible - or just hide Objects and .gif's (which also stumps me).
Vivv
PS - Webmaster World is a fantastic place. :D
javascript:a=document.getElementsByTagName('iframe');
b=document.getElementsByTagName('EMBED');
c=document.getElementsByTagName('img');
for(n=0;n<a.length;n++){i=a[n];
if(i.width!=0&&i.height!=0)i.style.visibility='hidden'};
for(n=0;n<b.length;n++){i=b[n];
if(i.width!=0&&i.height!=0)i.style.visibility='hidden'};
for(n=0;n<c.length;n++){i=c[n];
if(i.width!=0&&i.height!=0)i.style.visibility='hidden';}void 0;
now, when this bookmarklet is triggered, all iframes, embedded objects, and gifs are hidden...dramatically quieting down the page for easier user content digestion.
Chris
javascript:a=document.getElementsByTagName('iframe'); // get all iframes
b=document.getElementsByTagName('EMBED'); // get all flash
c=document.getElementsByTagName('img'); // get all images
for(n=0;n<a.length;n++){ // loop thru all iframes and hide 'em
i=a[n];
i.style.visibility='hidden';
}
for(n=0;n<b.length;n++){ // loop thru all embeds and hide
i=b[n];
i.style.visibility='hidden';
};
for(n=0;n<c.length;n++){ // loop thru all images
i=c[n];
q=i.src;
x = /.gif/.test(q); // find all gifs
if(x==true)i.style.visibility='hidden'; // if a gif then hide
}
void 0;
here is the code in a nice single chunk, to paste into a bookmark (in order to generate a bookmarklet)
javascript:a=document.getElementsByTagName('iframe');b=document.getElementsByTagName('embed');c=document.getElementsByTagName('img');for(n=0;n<a.length;n++){i=a[n];i.style.visibility='hidden';}for(n=0;n<b.length;n++){i=b[n];i.style.visibility='hidden';};for(n=0;n<c.length;n++){i=c[n];q=i.src;x =/gif/.test(q);if(x==true)i.style.visibility='hidden';}void 0;
Viv