Last active
February 20, 2021 02:04
-
-
Save 1UPNuke/742624e2945a59344326afd7b77efab6 to your computer and use it in GitHub Desktop.
User script that replaces the twitter box denoting the image has ALT text with the real ALT text.
This file contains hidden or 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
| // ==UserScript== | |
| // @name Twitter show ALT text | |
| // @version 1.0.0 | |
| // @author 1-UP Nuke | |
| // @icon https://abs.twimg.com/favicons/twitter.ico | |
| // @description Replaces the twitter box denoting the image has ALT text with the real ALT text. | |
| // @match https://*.twitter.com/* | |
| // @grant none | |
| // ==/UserScript== | |
| window.addEventListener('load', function() { | |
| setInterval(()=>{ | |
| for(let span of document.querySelectorAll('span')) | |
| { | |
| if(span.textContent == 'ALT') | |
| { | |
| let altBox = span.parentElement.parentElement; | |
| altBox.style.maxWidth = '90%'; | |
| altBox.style.height = 'max-content'; | |
| span.textContent = 'ALT: ' + altBox.parentElement.querySelector('img').alt; | |
| } | |
| } | |
| }, | |
| 1000 | |
| ) | |
| }, false); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment