1
var notification = new Notification(theTitle, options);
notification.onclick = function() {
window.location.href = theLink; //redirects to the specified link
};
我試圖通過單擊通知框打開新選項卡。使用上面的代碼重定向工作正常。但我想在新標籤中打開鏈接。我怎樣才能做到這一點?window.location.href - 在新選項卡中的鏈接
''window.open'' –
https://stackoverflow.com/questions/4907843/open-a-url-in-a-new-tab-and -not-a-new-window-using-javascript –
https://stackoverflow.com/questions/15818892/chrome-javascript-window-open-in-new-tab –