gpt4 book ai didi

javascript - Chrome 丰富通知未显示

转载 作者:行者123 更新时间:2023-11-28 01:30:36 24 4
gpt4 key购买 nike

好吧,在我的 Chrome 扩展程序 list 中,我已经允许通知,现在我正在使用 webkitNotifications,尽管我说的是丰富通知并且更喜欢它们,所以我继续思考如何编写它们需要哪些参数,所以我在控制台中进行了测试,但它没有显示?

chrome.notifications.create('report',{
type:'basic',
title:'hello world',
message:'Dance with me please',
expandedMessage:'Hello thanks for using our app',
priority:1,
buttons:[{title:'Follow URL'},{title:'Remind me Later'}],
isClickable:true
},function(){});

但我不确定这是否是我所需要的,因为 webkitNotifications 需要一个 show() 函数来实际显示它。大家有什么想法吗?

最佳答案

iconUrlcreate 方法所必需的。 http://developer.chrome.com/extensions/notifications#type-NotificationOptions

chrome.notifications.create('report',{
type:'basic',
title:'hello world',
iconUrl: 'yourIconUrl',
message:'Dance with me please',
expandedMessage:'Hello thanks for using our app',
priority:1,
buttons:[{title:'Follow URL'},{title:'Remind me Later'}],
isClickable:true
},function(){});

关于javascript - Chrome 丰富通知未显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22156955/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com