Skip to content

Instantly share code, notes, and snippets.

@obfusk
Last active February 15, 2025 22:03
Show Gist options
  • Select an option

  • Save obfusk/0e9203a2fc9e883a273413ff9173d7ab to your computer and use it in GitHub Desktop.

Select an option

Save obfusk/0e9203a2fc9e883a273413ff9173d7ab to your computer and use it in GitHub Desktop.
reload all broken images
// firefox only
(async () => { for (const x of document.querySelectorAll("img:-moz-broken")) { x.src = x.src; await new Promise(r => setTimeout(r, 100)); console.log(x) }; console.log("done") })()
// generic
(async () => { for (const x of document.querySelectorAll("img")) { if (!x.naturalWidth) { x.src = x.src; await new Promise(r => setTimeout(r, 100)); console.log(x) } }; console.log("done") })()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment