且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

iOS Web App的后台行为(因此应用程序不会重新启动)

更新时间:2023-01-25 17:47:01

ive使它像这样工作:

ive got it working like this:

if(window.navigator.standalone === true) {
    var lastpage = localStorage.getItem('exitsatus');
    if (lastpage==null){
        lastpage = "index.html";
    }
    if(document.referrer.length > 0 && document.referrer.indexOf("mysite.com") != -1){
        var lastpageupdate = window.location;
        localStorage.setItem('exitsatus',lastpageupdate);      
    } else {
        window.location = lastpage;
    }
}