[ prog / sol / mona ]

prog


javashit redirect script

11 2020-01-09 16:17

Ok this is the finished version. Only problem is, the whole purpose of it is to prevent loading pages from the variable ```sites```. And this script seems to load the page first then redirect to archive.org. I think the iteration of the sites array is slowing things down. Can the code be optimized? What if instead of the iteration I just copy pasted the code for each site? Would that quicken things?

var url = window.location.toString();

var sites = ['thesun.co.uk','telegraph.co.uk','dailymail.co.uk','thetimes.co.uk'];

// Redirecting 

for (i=0;i<sites.length;i++) {

   if (url.indexOf(sites[i]) != - 1) {
        location.href='https://web.archive.org/web/*/'+location.href;
    
  } 

}
15


VIP:

do not edit these