I’m trying to develop a basic Chrome extension that plays a sound, based on a speech input event (everything happens in the background).
Here’s my manifest
{
"manifest_version" : 2,
"name" : "Test123",
"version" : "1.0",
"description" : "My audio extension",
"icons" : {
"128" : "icon.jpg"
},
"permissions" : [
"experimental",
"background"
],
"background" : {
"persistent" : true,
"scripts" : [
"bg.js"
]
},
}
In bg.js
, I get the window
object with var chrome.extension.getBackgroundPage();
, but I can’t figure what to do from there.
How can I play an audio file?