The following code hides all webpages of a certain website and mocks the website.
let sites = ['mako.co.il', 'walla.co.il'];
for (let i = 0; i < sites.length; i++) {
if (window.location.href.indexOf(sites[i]) != -1 ) {
alert(` Enough with this ${sites[i]} shit! `);
}
}
It displays domain.tld this way:
“Enough with this domain.tld shit!”.
How could I strip away the .tld, so the final outcome would be:
“Enough with this domain shit!”.
A /[domain]@.2,/ regex might unmatch tld’s like .com or co.uk and only “domain” will appear on the alert, but I don’t know how to implement such regex to the sites[i] in the confirm.