gpt4 book ai didi

javascript - iPad 书签不弹出

转载 作者:行者123 更新时间:2023-11-28 21:06:20 25 4
gpt4 key购买 nike

我有一个 js 书签,它可以在所有浏览器上完美运行。单击时会生成一个弹出窗口。除了 iPad - 它会生成一个新选项卡,而不是弹出窗口

注意:我已关闭 Safari 中的阻止弹出窗口功能

这是我使用的书签代码:

javascript:(function(){window.open('http://****.com/pages/bm/add.html?
page_title='+document.title+'&rl='+encodeURIComponent(window.location.href),
'bookmarklet','left=100,top=100,width=610,height=700,personalbar=0,toolbar=0
,scrollbars=1,resizable=1')})()

最佳答案

对前两个答案的澄清,这是可能的,但您不能依赖该行为,因为它是用户偏好:

By default, Safari on iOS blocks pop-up windows. However, it is a preference that the user can change. To change the Safari settings, tap Settings followed by Safari. The Block Pop-ups setting appears in the Security section. From: http://developer.apple.com/library/ios/#DOCUMENTATION/AppleApplications/Reference/SafariWebContent/CreatingContentforSafarioniPhone/CreatingContentforSafarioniPhone.html

这是一个查看源书签,会弹出一个新窗口。尝试一下这个,看看它是否有效:

javascript:(function()%7Bvar%20a=window.open(%22about:blank%22).document;a.write(%22%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3Ctitle%3ESource%20of%20%22+location.href+'%3C/title%3E%3Cmeta%20name=%22viewport%22%20content=%22width=device-width%22%20/%3E%3C/head%3E%3Cbody%3E%3C/body%3E%3C/html%3E');a.close();var%20b=a.body.appendChild(a.createElement(%22pre%22));b.style.overflow=%22auto%22;b.style.whiteSpace=%22pre-wrap%22;b.appendChild(a.createTextNode(document.documentElement.innerHTML))%7D)();

关于javascript - iPad 书签不弹出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9785297/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com