Skip to content

Instantly share code, notes, and snippets.

@sackeyjason
Last active September 19, 2023 10:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sackeyjason/29d24c2fa7314fd14f10d959f93c3299 to your computer and use it in GitHub Desktop.
Save sackeyjason/29d24c2fa7314fd14f10d959f93c3299 to your computer and use it in GitHub Desktop.
Web greyscale, colouring

Background

https://twitter.com/ParkerNathans/status/1435270801905831942

uBlock Origin filter

*##html:style(filter:grayscale(1))
localhost##html:style(filter:grayscale(0))
... etc.

Bookmarklet to restore colour - click to toggle

Source

st = !window.st;
document.querySelector("html").style.setProperty("filter", st ? "none" : "grayscale(1)");

'Compiled' bookmarklet URL

javascript:(function()%7Bst%20%3D%20!window.st%3Bdocument.querySelector(%22html%22).style.setProperty(%22filter%22%2C%20st%20%3F%20%22none%22%20%3A%20%22grayscale(1)%22)%7D)()

colour pls via https://mrcoles.com/bookmarklet/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment