Safari extension that causes reload, .js seems to get added over and over

168 Views Asked by At

The context here is a Safari Extension, the script is added as an "End Script" in an extension. The purpose is to make MS exchange Web Access on Safari less painful, just by refreshing periodically... The main thing I am noticing is that according to the web inspector it adds this .js file each and every reload.

enter image description here

here is the code, if it is relevant:

if (window.top === window) {
    var whitelistURLPartials = ["ae\=Folder","ae\=Item\&t\=IPM.Note\&id"];

    var current = window.location.href;
    for (var index in whitelistURLPartials)
    {
        if(current.match(whitelistURLPartials[index]))
        {
            window.setTimeout(function(){document.location.reload(true)},1000*60);
            break;
        }
    }
}
1

There are 1 best solutions below

1
On

I am not sure what you want to achieve, you are bound to an infinite Loop of Forever Loading Pages when you strike a match.

I tried your scenario in Chrome Extensions and Safari 5.1.7 they are not added as in your Screen shot.

Is your Script being executed multiple times or Is it only visually wrong?