我尝试了各种自动重定向功能,看看如果不支持浏览器版本,我是否无法触发它。我们想要做的是重定向用户而不是给他们弹出窗口。我们正在使用browser-update.org
<script>
var $buoop = {
vs: {i:6,f:2,o:9.63,s:2,c:10}, // browser versions to notify
reminder: 0, // atfer how many hours should the message reappear
// 0 = show all the time
reminderClosed: 0, // if the u,ser closes message it reappears after x hours
onshow: function(infos){}, // callback function after the bar has appeared
onclick: function(infos){}, // callback function if bar was clicked
onclose: function(infos){}, //
l: false, // set a language for the message, e.g. "en"
// overrides the default detection
test: true, // true = always show the bar (for testing)
text: "test me now what", // custom notification html text
// Optionally include up to two placeholders "%s" which will be replaced with the browser version and contents of the link tag. Example: "Your browser (%s) is old. Please <a%s>update</a>"
text_xx: "", // custom notification text for language "xx"
// e.g. text_de for german and text_it for italian
newwindow: true, // open link in new window/tab
url: 'http://google.com', // the url to go to after clicking the notification
show: function(){
console.log('show fired')
window.location = "http://google.com"
}
};
function $buo_f(){
var e = document.createElement("script");
e.src = "//browser-update.org/update.min.js";
document.body.appendChild(e);
};
try {document.addEventListener("DOMContentLoaded", $buo_f,false)}
catch(e){window.attachEvent("onload", $buo_f)}
</script>
//
我查找了有关如何执行此操作的文档,但找不到任何内容。如果有人知道这个系统如何工作以覆盖点击功能并自动绕过弹出窗口并将用户带到另一个页面,那就太棒了。
如果您将此脚本放入基本的html页面,它应立即生效。我已经开始测试了:因为它可以在任何浏览器中测试。
希望通过创建此帖子,它将为其他人解决同样的问题。
全心全意,
布兰登