Last active
June 12, 2022 10:49
-
-
Save coderofsalvation/5c1eb5de2e1955206b7986939ed180d7 to your computer and use it in GitHub Desktop.
bookmarketlet to mark clicked images as seen
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
<a href="javascript:(function()%7BsetInterval(%20()%20%3D%3E%20%7B%0A%20%20%20%20let%20imgs%20%3D%20%5B...document.querySelectorAll(%22img%22)%5D%0A%20%20%20%20imgs.map(%20(i)%20%3D%3E%20%7B%0A%20%20%20%20%20%20let%20rec%20%3D%20localStorage.getItem(i.src)%3B%0A%20%20%20%20%20%20if(%20rec%20)%7B%0A%20%20%20%20%20%20%20%20i.style.opacity%20%3D%200.15%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20i.addEventListener('click'%2C%20((i)%20%3D%3E%20()%20%3D%3E%20localStorage.setItem(i.src%2C'%7B%7D'))(i)%20)%0A%20%20%20%20%7D)%0A%7D%2C2000)%7D)()%3B">marketplace_seenmarker</a> |
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
javascript:(function()%7BsetInterval(%20()%20%3D%3E%20%7B%0A%20%20%20%20let%20imgs%20%3D%20%5B...document.querySelectorAll(%22img%22)%5D%0A%20%20%20%20imgs.map(%20(i)%20%3D%3E%20%7B%0A%20%20%20%20%20%20let%20rec%20%3D%20localStorage.getItem(i.src)%3B%0A%20%20%20%20%20%20if(%20rec%20)%7B%0A%20%20%20%20%20%20%20%20i.style.opacity%20%3D%200.15%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20i.addEventListener('click'%2C%20((i)%20%3D%3E%20()%20%3D%3E%20localStorage.setItem(i.src%2C'%7B%7D'))(i)%20)%0A%20%20%20%20%7D)%0A%7D%2C2000)%7D)()%3B |
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( () => { | |
let imgs = [...document.querySelectorAll("img")] | |
imgs.map( (i) => { | |
let rec = localStorage.getItem(i.src); | |
if( rec ){ | |
i.style.opacity = 0.15 | |
} | |
i.addEventListener('click', ((i) => () => localStorage.setItem(i.src,'{}'))(i) ) | |
}) | |
},2000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment