Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- javascript:(function(){
- let saveBlob = (function () {
- let a = document.createElement("a");
- document.body.appendChild(a);
- a.style = "display: none";
- return function (blob, fileName) {
- let url = window.URL.createObjectURL(blob);
- a.href = url;
- a.download = fileName;
- a.click();
- window.URL.revokeObjectURL(url);
- };
- }());
- let a = document.querySelectorAll('a');
- let emails = [];
- for(let i = 0; i < a.length; i++) {
- let e = a[i];
- if (e.href && e.href.startsWith('mailto:')) {
- let email = e.href.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9_-]+)/gi);
- if (email.length > 0 && emails.indexOf(email[0]) == -1) {
- emails.push(email[0]);
- }
- }
- }
- if (emails.length > 0) {
- let blob = new Blob([emails.join("\r\n")], { type: "text/plain;charset=utf-8"});
- saveBlob(blob, 'emails.txt');
- } else {
- alert('no mailto addresses');
- }
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement