Skip to content

Instantly share code, notes, and snippets.

@cogdog
Forked from bennettscience/altChecker.js
Last active November 22, 2021 00:44
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 cogdog/c133fdfe2d7af56ba1a90e5e9a57fcbc to your computer and use it in GitHub Desktop.
Save cogdog/c133fdfe2d7af56ba1a90e5e9a57fcbc to your computer and use it in GitHub Desktop.
Mod
/* 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;
head.appendChild(style);
}
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;}");})();
@cogdog
Copy link
Author

cogdog commented Nov 22, 2021

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