It seems simple but I have been trying this for a while. Every time I add a link to the push notification, the urls open at different tabs for different links. Actually for the first notification, it opens in a single tab, for the second notification, it opens up in two tabs with the same url accessed. The tabs keep increasing.. please help.
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);
}
}
The newItems array is to fetch content for a new product uploaded