Skip to content

Commit 49d06e4

Browse files
author
hoang.tran12
committed
fix duplicate emails
1 parent 4c63034 commit 49d06e4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/getAllEmailsInWeb.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ export default {
99
vi: "Trích xuất tất cả emails trong web và hiện trong popup mới",
1010
},
1111

12+
changeLogs: {
13+
"2024-05-20": "remove duplicate emails",
14+
},
15+
1216
pageScript: {
1317
onClick: function () {
1418
// source code from: https://bookmarklet.vercel.app/
@@ -19,7 +23,7 @@ export default {
1923
/(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/g;
2024
let found = haystack.match(regex);
2125
if (found !== null && found !== "") {
22-
let mailz = found.join("\r\n<br>");
26+
let mailz = Array.from(new Set(found)).join("\r\n<br>");
2327
let w = window.open(
2428
"",
2529
"mailz",

0 commit comments

Comments
 (0)