Skip to content

Instantly share code, notes, and snippets.

@tfluehr
tfluehr / blinky
Created September 18, 2009 18:28 — forked from fermion/blinky
Blinky Bookmarklet
javascript:(function(){function anc(e){var p='parentNode';e=$(e);var es=[];while(e=es[property])if(e.nodeType==1)es.push(e);return es;}function visible(el){el=$(el);if(!el){return false;}var a=anc(el);var c=a.length;var v=true;for(var i=0;i<c;i++){if(a[i].style.display=='none'||a[i].style.visibility=='hidden'){v=false;break;}}return v;}(function blinky(){var tmp=document.body.getElementsByTagName('*');tags=[];for(var j=0;j<tmp.length;j++)tags.push(tmp[j]);var fr=[];var ind=[];var l=tags.length;while(l--)var n=tags[l].tagName.toLowerCase();if(n=='iframe'||n=='script'||n=='link'){if(tags[l].tagName.toLowerCase()=='iframe')fr.push(tags[l]);tags[l]=null;ind.push(l);}while(ind.length)Array.splice.call(tags,ind.shift(),1);while(fr.length){try{tmp=fr.shift().contentWindow.document.body.getElementsByTagName('*');var tmp2=[];for(var j=0;j<tmp.length;j++)tmp2.push(tmp[j]);tags=Array.concat.apply(tags,tmp2);}catch(e){}}l=tags.length;if(typeof(lastTag)=='undefined')lastTag=null;if(lastTag)lastTag.style.visibility='';last
var scrollbarWidth;
function getScrollbarWidth() {
if (scrollbarWidth) {
return scrollbarWidth;
}
var inner = document.createElement('p');
inner.style.width = '100%';
inner.style.height = '200px';
var outer = document.createElement('div');