Bookmarklet Dump
Bookmarklet Dump
Deleting an old repo and found these Bookmarklet gems. Drag to your bookmark bars and have fun! I can't remember where I copied any of them from, sorry.
Kill Sticky
Kills sticky popups
javascript:(function(){(function()%20{var%20i,%20elements%20=%20document.querySelectorAll('body%20*');for%20(i%20=%200;%20i%20<%20elements.length;%20i++)%20{if%20(getComputedStyle(elements[i]).position%20===%20'fixed')%20{elements[i].parentNode.removeChild(elements[i]);}}})()})()
Wikipedia lookup
javascript:(function()%20{%20function%20se(d)%20{%20return%20d.selection%20?%20d.selection.createRange().text%20:%20d.getSelection()%20}%20s%20=%20se(document);%20for%20(i=0;%20i<frames.length%20&&%20!s;%20i++)%20s%20=%20se(frames[i].document);%20if%20(!s%20||%20s=='')%20s%20=%20prompt('Enter%20search%20terms%20for%20Wikipedia','');%20open('http://en.wikipedia.org'%20+%20(s%20?%20'/w/index.php?title=Special:Search&search='%20+%20encodeURIComponent(s)%20:%20'')).focus();%20})();
Delete Google Sheet
javascript:(function()%20{%20%20%20%20var%20eltMove%20=%20document.querySelector('#\\:b2>div>span');%20%20%20%20fireMouseEvent(document.querySelector('#docs-file-menu'),%20'mousedown');%20%20%20%20fireMouseEvent(eltMove,%20'mousedown');%20%20%20%20fireMouseEvent(eltMove,%20'mouseup');%20%20%20%20fireMouseEvent(eltMove,%20'mouseup');%20%20%20%20function%20fireMouseEvent(eltTarget,%20myEvent)%20{%20%20%20%20%20%20%20%20var%20screenX,%20screenY,%20clientX,%20clientY;%20%20%20%20%20%20%20%20var%20event%20=%20document.createEvent('MouseEvents');%20%20%20%20%20%20%20%20event.initMouseEvent(myEvent,%20true,%20true,%20window,%201,%20screenX,%20screenY,%20clientX,%20clientY,%20false,%20false,%20false,%20false,%200,%20null);%20%20%20%20%20%20%20%20eltTarget.dispatchEvent(event);%20%20%20%20}})();
Copy and Alert the components of a URL
Copy and Alert the components of a URL
javascript:(function(){u=(window.location.protocol);v=(window.location.href);w=(window.location.hostname);x=(window.location.pathname);y=(window.location.search);z=(window.location.hash);a=("Protocol: "+u+"\nHref: "+v+"\nHostname: "+w+"\nPathname: "+x+"\nSearch: "+y+"\nHash: "+z);navigator.clipboard.writeText(a);alert(a);})()
www=stage
javascript:(function(){var%20loc=location.href;if(loc.indexOf(%22www%22)>=0){loc=loc.replace('www','stage');}else{loc=loc.replace('stage','www');}location.replace(loc)})()
View Data Layer - ALERT
javascript:(function(){%20alert(JSON.stringify(dataLayer,%20function(key,value)%20{if(key%20==%20'gtm.element'){%20return%20'format';}%20return%20value;},%204))%20})();
View Data Layer - DIV
javascript:(function(a){a=document.createElement('div');a.style.position=%20'fixed';a.style.left='80%';a.style.right='0%';a.style.top='0%';a.style.zIndex='100000';a.style.background='white';a.innerHTML=%20JSON.stringify(dataLayer,%20function(key,value)%20{if(key%20==%20'gtm.element'){return%20'some%20element%20here';}%20return%20value;},%204);document.body.appendChild(a);})();