Skip to content

Instantly share code, notes, and snippets.

@n1k0
Last active December 19, 2023 13:50
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save n1k0/5fc432731a1ba4f0d71eb026b4ca693c to your computer and use it in GitHub Desktop.
Save n1k0/5fc432731a1ba4f0d71eb026b4ca693c to your computer and use it in GitHub Desktop.
Unblur bookmarlklet

Unblur bookmarklet

Too many websites rely on the CSS blur filter to cheaply obfuscate contents. Here's a bookmarklet to reset all active blur styles from the current page DOM.

(function() {
  for (const x of document.querySelectorAll("*")) {
    const s = getComputedStyle(x);
    for (const k in s) {
      if (k.includes("filter") && s.filter.includes("blur")) {
        x.style.filter = "";
      }
    }
  }
})();

Feel free to create a convenient bookmarklet out of this snippet using this tool.

@villeodell
Copy link

Thanks for this. Here is a small update so it works also in cases where there is css with higher specificity applying the blur.

(function() {
  for (const x of document.querySelectorAll("*")) {
    const s = getComputedStyle(x);
    for (const k in s) {
      if (k.includes("filter") && s.filter.includes("blur")) {
        x.style.setProperty("filter", "none", "important");
      }
    }
  }
})();

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