点击new tab
时如何在web notification
中打开网址,来自Safari扩展程序。
我有两个通知n1和n2,点击通知n1,nz应该打开" example1.com
"," example2.com
"在新标签中。
代码:
var n1= new Notification("hi user");
n1.onclick() = function(){ var url = "example1.com"; // open new tab };
n1.show();
var n2= new Notification("hi user"});
n2.onclick() = function(){ var url = "example2.com"; // open new tab };
n2.show();