Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
/* Modified version of Brian Bennett's bookmarklet for blurring
images in a page lacking alt descriptions, added class for missing alts */
// code version
(function() {
'use strict';
function addCssRule(rule) {
var head, style;
head = document.querySelector('head');
if (!head) { return; }
style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = rule;
addCssRule("img[alt=''],img:not([alt] { filter: blur(10px) !important; outline: 10px solid !important; }");
// This is version that can be used in bookmarklet
javascript: (function(){'use strict'; function addCssRule(rule){var head, style; head=document.querySelector('head'); if (!head){return;}style=document.createElement('style'); style.type='text/css'; style.innerHTML=rule; head.appendChild(style);}addCssRule("img[alt=''], img:not([alt]){filter: blur(10px) !important; outline: 10px solid !important;}");})();
Copy link

cogdog commented Nov 22, 2021


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