Skip to content

Instantly share code, notes, and snippets.

@hawtim
Created January 6, 2024 07:19
Show Gist options
  • Save hawtim/8f2cdc72a9a4fa09e07ffccf63bcfb23 to your computer and use it in GitHub Desktop.
Save hawtim/8f2cdc72a9a4fa09e07ffccf63bcfb23 to your computer and use it in GitHub Desktop.
get all external images by matching text content
Array.from(new Set(Array.from(new Set(Array.from(document.getElementsByTagName('*')).filter(item => item.innerText).map(item => item.innerText.includes('https') && item.innerText).filter(Boolean))).map(item => item.match(/https?:\/\/.*(img|image)+.*/gim)).flat(Infinity)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment