Last active
April 23, 2018 09:33
Revisions
-
ubershmekel revised this gist
Apr 23, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -9,7 +9,7 @@ setInterval(function() { if (alt && !imgs[i].getAttribute("alted")) { var div = document.createElement("div"); div.append(document.createTextNode(alt)); div.setAttribute("style", "position: absolute; top: 0; left: 0; z-index: 100; text-shadow: 0 0 4px #000; color: #fff;font-weight: bold;"); imgs[i].parentElement.prepend(div); imgs[i].setAttribute("alted", "1"); } -
ubershmekel revised this gist
Apr 23, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ // It's an interesting peek into how facebook analyzes your images. setInterval(function() { var imgs = document.querySelectorAll("img"); for (var i = 0; i < imgs.length; i++) { var alt = imgs[i].alt; if (alt && !imgs[i].getAttribute("alted")) { -
ubershmekel created this gist
Apr 23, 2018 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ // Paste the following into your js console while viewing images, e.g. on your facebook feed. // It will show the "alt" attributes that facebook assigned your images. // It's an interesting peek into how facebook analyzes your images. setInterval(function() { var imgs = document.querySelectorAll("img") for (var i = 0; i < imgs.length; i++) { var alt = imgs[i].alt; if (alt && !imgs[i].getAttribute("alted")) { var div = document.createElement("div"); div.append(document.createTextNode(alt)); div.setAttribute("style", "position: absolute; top: 0; left: 0; z-index: 100; text-shadow: 1px 1px #000; color: #fff;font-weight: bold;"); imgs[i].parentElement.prepend(div); imgs[i].setAttribute("alted", "1"); } } }, 1000);