iPhone Safari Web App 在新窗口中打开链接 [英] iPhone Safari Web App opens links in new window

查看:46
本文介绍了iPhone Safari Web App 在新窗口中打开链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将图标添加到主屏幕后,我遇到了网络问题.如果网络是从主屏幕启动的,所有链接都将在 Safari 的新窗口中打开(并失去全屏功能).我该如何预防?我找不到任何帮助,只有相同的未回答问题.

I have problem with web after adding icon to Home Screen. If the web is launched from Home Screen, all links will open in new window in Safari (and lose full screen functionality). How can I prevent it? I couldn't find any help, only the same unanswered question.

推荐答案

我在 iWebKit 框架中找到了 JavaScript 解决方案:

I found JavaScript solution in iWebKit framework:

var a=document.getElementsByTagName("a");
for(var i=0;i<a.length;i++)
{
    a[i].onclick=function()
    {
        window.location=this.getAttribute("href");
        return false
    }
}

这篇关于iPhone Safari Web App 在新窗口中打开链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆