0
シンプルなようですが、私はこれをしばらく試しています。プッシュ通知へのリンクを追加するたびに、URLはさまざまなリンクの別のタブで開きます。実際に最初の通知の場合は、1つのタブで開き、2つ目の通知の場合は、同じURLにアクセスした2つのタブで開きます。タブは増加し続ける..助けてください。Chromeのデスクトッププッシュ通知を同じタブで開くにはどうすればよいですか?
for(i=0;i<newItems.length; i++){
var myItem = {
type: "basic",
title: "New Product Alert!",
message: newItems[i],
contextMessage: "Product Notifier",
buttons: [{
title: "View Product"
}],
iconUrl: "origi.png"
};
chrome.notifications.onButtonClicked.addListener(function(){
window.open('https://www.product.co.ke/electronics-video/');
});
chrome.notifications.create(myItem);
}
}
newItems配列は、新製品のためのコンテンツを取得することであるあなたがwindow.open
の2番目のパラメータとして「_self」を追加試すことができる