-
-
Save cogdog/c133fdfe2d7af56ba1a90e5e9a57fcbc to your computer and use it in GitHub Desktop.
Mod
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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;}");})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For reference, https://blog.ohheybrian.com/2021/11/check-for-alt-tags-with-a-bookmarklet/