admin管理员组文章数量:1357583
I've got this Tampermonkey extension:
// ==UserScript==
// @name Open Window and Change Address
// @match /
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// @run-at document-idle
// ==/UserScript==
(function () {
"use strict";
function delay (time) {
var stop;
stop = Date.now() + time;
while (Date.now() < stop) {}
}
function enter () {
var i;
var u;
var w;
try {
for (i = 0; i < urls.length; i++) {
u = urls[i];
if (i === 0) {
w = window.open(u);
} else {
delay(250);
w.location.href = u;
}
}
} catch (e) {
alert(String(e));
}
}
var btn;
var urls;
try {
urls = [
"/",
"/"
];
enter();
} catch (e) {
alert(String(e));
}
})();
It's supposed to open a new tab at address and then change the address in that tab (the purposes for this are irrelevant). I have pop-ups turned on in Safari. The problem is that the tab window.open
opens is blank and there is nothing in the address bar. I don't get it. Websites are able to do this. Why isn't this extension able to do it?
本文标签: domwindowopen not loading address in Safari on iOSStack Overflow
版权声明:本文标题:dom - window.open not loading address in Safari on iOS - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744063172a2584502.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论