You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _src/blocks/link-checker/link-checker.js
+97-41Lines changed: 97 additions & 41 deletions
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ import {
9
9
}from'../../scripts/utils/bot-prevention.js';
10
10
11
11
classStatusMessageFactory{
12
-
staticcreateMessage(status,url){
12
+
staticcreateMessage(status,url,statusMessages){
13
13
leturlObject=url;
14
14
// Ensure the URL has a protocol
15
15
if(!/^https?:\/\//i.test(url)){
@@ -22,46 +22,44 @@ class StatusMessageFactory {
22
22
urlObject.hostname=`www.${urlObject.hostname}`;
23
23
}
24
24
25
-
constmessages={
26
-
1: {text: 'The link is safe with no signs of harmful activity. You can go ahead and keep staying cautious online.',className: 'result safe',status: 'safe'},
27
-
2: {text: 'We haven\'t found any suspicious activity with this link. However, to stay safe going forward, make sure to use reliable security software and scan your system regularly.',className: 'result safe',status: 'so_far_so_good_1'},
28
-
3: {text: `This link looks safe, but the domain '${urlObject.hostname}' has been connected to harmful links in the past. To stay protected, check any other links from this domain using our tool and keep your security software updated.`,className: 'result safe',status: 'so_far_so_good_2'},
29
-
4: {text: 'This link is dangerous and can compromise your personal information or harm your device. Do not click it, and ensure your security software is up-to-date to stay protected from threats.',className: 'result danger',status: 'malware & phishing'},
30
-
5: {text: 'This link is known to distribute malware. Accessing it may harm your device, steal your data, or allow unauthorized access. Stay away from the site and ensure your security software is active.',className: 'result danger',status: 'malware'},
31
-
6: {text: 'This URL is linked to a server used to command and control malware on infected devices. Don’t click the link and make sure your security software is up to date to keep your device safe.',className: 'result danger',status: 'c&c'},
32
-
7: {text: 'This link is a threat, exposing you to malicious ads and phishing attempts that can steal your information and damage your device. Do not interact with it, and ensure your security software is updated.',className: 'result danger',status: 'malvertising & fraud & phishing'},
33
-
8: {text: 'This link directs to a fraudulent site intended to trick users and steal sensitive data. Stay away from the site and ensure your security software is active.',className: 'result danger',status: 'fraud'},
34
-
9: {text: 'This link leads to a phishing site designed to steal personal information like passwords or financial data. Stay away from the site and ensure your security software is active.',className: 'result danger',status: 'phishing'},
35
-
10: {text: 'This link is connected to harmful ads that could affect your device and expose your personal data, such as your passwords, credit card information, email addresses, or browsing history. Avoid clicking on it and keep your security software updated to stay safe.',className: 'result danger',status: 'malvertising'},
36
-
11: {text: 'This link is associated with apps that could slow down your device or compromise your privacy. It’s best to avoid the site and make sure your security settings are active.',className: 'result danger',status: 'pua'},
37
-
12: {text: 'This link is designed to look like a trusted site using tricky characters. Don’t click the link and make sure your security software is updated to protect your device.',className: 'result danger',status: 'homograph'},
38
-
13: {text: 'This URL is linked to cryptocurrency mining activities, which may use your device\'s resources without your consent. Avoid visiting the site and ensure your security protections are in place.',className: 'result danger',status: 'miner'},
39
-
14: {text: 'This URL is linked to crypto mining activity, which could use your device\'s resources if accessed. It’s recommended not to click the link and ensure your security software is up to date.',className: 'result danger',status: 'miner-server'},
40
-
15: {text: 'This link has been identified in spam emails, which often contain malicious content. Avoid clicking on it, as it may lead to harmful sites or scams. Ensure your security measures are in place.',className: 'result danger',status: 'spam'},
41
-
16: {text: 'This URL is likely to contain malware, posing a significant threat. It\'s strongly advised to avoid accessing it and ensure your security protections are active and up to date.',className: 'result danger',status: 'malware-hd'},
42
-
17: {text: 'This link appears suspicious and may not be trustworthy. It’s best to avoid accessing it. Keep your security software active and steer clear of the site.',className: 'result danger',status: 'untrusted'},
43
-
18: {text: 'This link is unsafe and could harm your device or steal your personal information. Avoid clicking on it and keep your security software updated to stay safe.',className: 'result danger',status: 'malicious'},
44
-
other: {text: 'This link is unsafe and could harm your device or steal your personal information. Avoid clicking on it and keep your security software updated to stay safe.',className: 'result danger',status: 'other'},
25
+
// Manually defined mapping of number keys to status strings
0 commit comments