未介绍的参考:未定义音频
Heyo,我想向Google商店发布扩展,但我无法使用清单V2。
目前试图迁移到V3,但我正在未介绍的参考文献:Audio在我的背景中没有定义。
仅使用JS / HTML / CSS
编辑:我也有“服务工作者注册失败”警告,可能与此有关吗?
编辑2:似乎只有当铬启动时才有这个问题。如果我单击“扩展名”图标,以打开默认弹出窗口,此后所有内容都很好。
有没有一种方法可以使其在Chrome开始时弹出或解决该问题?
{
"manifest_version": 3,
"name": "test name",
"description": "test description",
"version": "0.1",
"action": {
"default_popup": "index.html"
},
"icons": {
"64" : "img/x.png"
},
"background": {
"service_worker": "background.js"
},
"permissions": [
"storage",
"notifications"
]
清单
notifsoundLive = "/mp3/barou.wav";
soundnotif = 0;
// Volume
var son = new Audio(notifsoundLive);
son.volume = .5;
Heyo, I wanted to publish an extention to the google store but I couldn't with manifest v2.
Currently trying to migrate to v3 but i'm getting Uncaught ReferenceError: Audio is not defined in my background.js.
Only using JS / HTML / CSS
EDIT : I also have a "Service worker registration failed" warning, might be related to that?
EDIT 2 : Seems to only have this problem when chrome starts. If i'm clicking on the extension's icon that opens the default popup everything is fine after that.
Is there a way to make it popup at the start of chrome or a way to fix that?
manifest.json
{
"manifest_version": 3,
"name": "test name",
"description": "test description",
"version": "0.1",
"action": {
"default_popup": "index.html"
},
"icons": {
"64" : "img/x.png"
},
"background": {
"service_worker": "background.js"
},
"permissions": [
"storage",
"notifications"
]
}
background.js
notifsoundLive = "/mp3/barou.wav";
soundnotif = 0;
// Volume
var son = new Audio(notifsoundLive);
son.volume = .5;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论