2024-04-23 18:50:35 -03:00
|
|
|
const socialMediaBlocklist = [
|
|
|
|
|
'facebook.com',
|
|
|
|
|
'twitter.com',
|
|
|
|
|
'instagram.com',
|
|
|
|
|
'linkedin.com',
|
|
|
|
|
'pinterest.com',
|
|
|
|
|
'snapchat.com',
|
|
|
|
|
'tiktok.com',
|
|
|
|
|
'reddit.com',
|
|
|
|
|
'tumblr.com',
|
|
|
|
|
'flickr.com',
|
|
|
|
|
'whatsapp.com',
|
|
|
|
|
'wechat.com',
|
|
|
|
|
'telegram.org',
|
|
|
|
|
];
|
|
|
|
|
|
2024-05-20 17:24:21 -07:00
|
|
|
const allowedKeywords = [
|
|
|
|
|
'pulse',
|
|
|
|
|
'privacy',
|
|
|
|
|
'terms',
|
|
|
|
|
'policy',
|
|
|
|
|
'user-agreement',
|
|
|
|
|
'legal',
|
2024-05-20 17:26:01 -07:00
|
|
|
'help',
|
|
|
|
|
'support',
|
|
|
|
|
'contact',
|
|
|
|
|
'about',
|
|
|
|
|
'careers',
|
|
|
|
|
'blog',
|
|
|
|
|
'press',
|
|
|
|
|
'conditions',
|
2024-04-25 08:39:45 -03:00
|
|
|
];
|
|
|
|
|
|
2024-04-23 18:50:35 -03:00
|
|
|
export function isUrlBlocked(url: string): boolean {
|
2024-05-20 17:24:21 -07:00
|
|
|
if (allowedKeywords.some(keyword => url.includes(keyword))) {
|
2024-04-25 08:39:45 -03:00
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2024-04-23 18:50:35 -03:00
|
|
|
return socialMediaBlocklist.some(domain => url.includes(domain));
|
|
|
|
|
}
|