【发布时间】:2016-07-10 16:38:29
【问题描述】:
Chrome 扩展程序运行良好。我的问题是通知会在 7 秒内关闭。我想让用户点击关闭通知。
function engine(){
var latestId;
var ids;
var messages = [];
var newmessage = [];
$.get('http://localhost/site/json.php',function (data){
var json = $.parseJSON(data);
messages = json;
ids = json[0].id;
if(latestId == ids){
//no update
}else if(latestId === undefined){
var run = {
type: "basic",
title: "Title",
message: "Some message",
iconUrl : "icon.png",
};
chrome.notifications.create(run);
}
});
}
【问题讨论】:
-
不确定你在问什么。您是希望在单击通知时关闭通知,还是希望在 7 秒后不隐藏通知并仅在用户交互时关闭?
标签: javascript google-chrome-extension