3 ms·
I came up with: document.documentElement.innerHTML.split('\n').forEach( (line) => line.includes('mailto:') ? console.log(line) : 0 ) But please push this furt
by vxcwvxcw 7y ago
I came up with:
document.documentElement.innerHTML.split('\n').forEach( (line) => line.includes('mailto:') ? console.log(line) : 0 )
But please push this further (is there a shorter way to say document.documentElement.innerHTML ?)
- nawgszy 7y agoNot minimized but generates a file 'emails.txt': a = document.createElement('a'); a.download = 'emails.txt'; a.href = `data:text/plain,${Array.from(document.querySelectorAll('a')).map(a => a.href).filter(s => ~s.indexOf('mailto')).join(',')}`; document.body.appendChild(a); a.click();
- sushisource 7y agoThat's a really cool trick for creating a file you can download.