Skip to content

Instantly share code, notes, and snippets.

@BigEd
Last active February 16, 2016 11:22
Show Gist options
  • Save BigEd/5d15802ccce1998043bf to your computer and use it in GitHub Desktop.
Save BigEd/5d15802ccce1998043bf to your computer and use it in GitHub Desktop.
Useful bookmarklets for better-looking browsing: remove nuisances and improve readability

Some bookmarklets for improving the appearance and usability of websites.

See also rdd.me aka readability.com who have a bookmarklet which usually reformats just the main text of a page into a readable format, and can also email or send to a Kindle.

blacktext - change text to black to improve contrast allgrey - change background colours to grey, which I find much more relaxing greenlinks - make hyperlinks dark green which shows up better zapit - delete an annoying element like a sidebar or header or footer greythis - make one element's background colour grey, in case allgrey missed it

You might well want to change the shade of grey used. It can be helpful if allgrey and greythis have different shades for different situations.

javascript:(function(){var x=document.querySelectorAll('div');for(var i=0;i<x.length;i++){x[i].style.backgroundColor="#aaa"}})();void(0)
javascript:(function(){var x=document.querySelectorAll('p');for(var i=0;i<x.length;i++){x[i].style.color="#000"}})();void(0)
javascript:(function(){var e=document.body.style.cursor;document.body.style.cursor="crosshair";var t=document.createElement("div");var n="border:1px solid #3280FF;background-color:rgba(50,128,255,0.5);position:absolute;z-index:999999999999999;display:none;";var r="pointer-events:none;";var i="transition:width 60ms,height 60ms,left 60ms,top 60ms;";n+=r+"-webkit-"+r+"-moz-"+r;n+=i+"-webkit-"+i+"-moz-"+i;t.setAttribute("style",n);document.body.appendChild(t);var s=null;var o=function(e){var n=e.target;if(n!==s&&n.parentNode){var r=n.getBoundingClientRect();var i=document.documentElement;var o=document.body;var u=i.clientTop||o.clientTop||0;var a=i.clientLeft||o.clientLeft||0;var f=window.pageYOffset||i.scrollTop||o.scrollTop;var l=window.pageXOffset||i.scrollLeft||o.scrollLeft;var c=l-a+r.left-1;var h=f-u+r.top-1;t.style.display="block";t.style.left=c+"px";t.style.top=h+"px";t.style.width=r.width+"px";t.style.height=r.height+"px";s=n}};var u=function(n){document.body.style.cursor=e;n.target.style.backgroundColor="#bbb";if(t.parentNode)t.parentNode.removeChild(t);window.removeEventListener("click",u,false);window.removeEventListener("mouseover",o,false);n.stopPropagation();n.preventDefault()};window.addEventListener("mouseover",o,false);window.addEventListener("click",u,false)})();void(0
javascript:(function(){var e=document.body.style.cursor;document.body.style.cursor="crosshair";var t=document.createElement("div");var n="border:1px solid #3280FF;background-color:rgba(50,128,255,0.5);position:absolute;z-index:999999999999999;display:none;";var r="pointer-events:none;";var i="transition:width 60ms,height 60ms,left 60ms,top 60ms;";n+=r+"-webkit-"+r+"-moz-"+r;n+=i+"-webkit-"+i+"-moz-"+i;t.setAttribute("style",n);document.body.appendChild(t);var s=null;var o=function(e){var n=e.target;if(n!==s&&n.parentNode){var r=n.getBoundingClientRect();var i=document.documentElement;var o=document.body;var u=i.clientTop||o.clientTop||0;var a=i.clientLeft||o.clientLeft||0;var f=window.pageYOffset||i.scrollTop||o.scrollTop;var l=window.pageXOffset||i.scrollLeft||o.scrollLeft;var c=l-a+r.left-1;var h=f-u+r.top-1;t.style.display="block";t.style.left=c+"px";t.style.top=h+"px";t.style.width=r.width+"px";t.style.height=r.height+"px";s=n}};var u=function(n){document.body.style.cursor=e;if(n.target.parentNode)n.target.parentNode.removeChild(n.target);if(t.parentNode)t.parentNode.removeChild(t);window.removeEventListener("click",u,false);window.removeEventListener("mouseover",o,false);n.stopPropagation();n.preventDefault()};window.addEventListener("mouseover",o,false);window.addEventListener("click",u,false)})();void(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment