简体   繁体   中英

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

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.

在此处输入图片说明

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;
        }
    }
}

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?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM