我正在为我们的票务系统设置自己的Chrome扩展程序。票到后,我想发出声音通知。我遇到以下错误。
我已经在清单中使用“ web_accessible_resources”嵌入了.mp3声音文件
我的MANIFEST.JSON
"manifest_version": 2,
"name": "Jingle Launcher",
"description": "Accessmenu for Jingle",
"version": "1.0.0",
"icons": {
"128": "images/icon_128.png"
},
"browser_action": {
"default_icon": "images/icon.png",
"default_popup": "popup.html"
},
"content_scripts": [
{
"matches": [
"https://*/*"
],
"web_accessible_resources": [
"alarm.mp3"
],
"js": [
"script.js"
]
}
]
我的SCRIPT.JS
var tickets = document.getElementsByClassName('AsBlock MasterActionLink');
var myAudio = new Audio(); myAudio.src =
chrome.extension.getURL("sounds/alarm.mp3");
if (tickets.length > 0) { myAudio.play(); }
else { console.log("Ticket not Found"); }
我收到这些错误消息