Last active
July 11, 2019 16:04
-
-
Save eusonlito/93a06c410bad8c65f62a583cd5a28c2b to your computer and use it in GitHub Desktop.
Show Facebook alt titles generated to images
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
setInterval(function () { | |
document.querySelectorAll('div.img-title').forEach(function (title) { | |
title.parentNode.removeChild(title); | |
}); | |
document.querySelectorAll('img.img').forEach(function (img) { | |
if (!img.alt) { | |
return; | |
} | |
var title = document.createElement('div'); | |
title.innerHTML = img.alt; | |
title.className = 'img-title'; | |
title.style = 'padding: 5px; background: black; color: white; font-weight: bold; opacity: 0.9; position: absolute; top: 0;'; | |
img.parentNode.insertBefore(title, img.nextSlibing); | |
}); | |
}, 2000); |
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
setInterval(function () { | |
document.querySelectorAll('div.img-title').forEach(function (title) { | |
title.parentNode.removeChild(title); | |
}); | |
document.querySelectorAll('img.FFVAD').forEach(function (img) { | |
if (!img.alt) { | |
return; | |
} | |
var title = document.createElement('div'); | |
title.innerHTML = img.alt; | |
title.className = 'img-title'; | |
title.style = 'padding: 5px; background: black; color: white; font-weight: bold; opacity: 0.9'; | |
img.parentNode.insertBefore(title, img); | |
}); | |
}, 2000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment