1
我正在使用Microsoft Edge擴展。Microsoft Edge Web導航重定向
我會重定向用戶,如果他們在一個特定的網址導航。 在我background.js腳本我有這樣的:
browser.webNavigation.onBeforeNavigate.addListener(
function(details) {
if(details.url.indexOf("url_path") > -1){
alert("caught");
window.location = "http://new_url.com";
}
}
);
警報工作,而不是重定向。我做錯了什麼? 也是一個好主意通過用戶通過http auth在重定向? 例如:windows.location =「http://user:[email protected]_url.com」?
謝謝:)