I'm working on another Chrome extension that will, when clicked, play a sound and display a png in the middle of the current webpage. Here's my manifest.json file:
{
"manifest_version": 2,
"name": "Picture Sound",
"description": "Picture Sound",
"version": "1.0",
"browser_action": {
"default_icon": "icon.png",
"scripts": ["picture.js"],
"default_title": "Picture Sound"
},
"background": {
"scripts": ["audio.js"],
"persistent": false
},
"permissions": [
"activeTab",
"https://ajax.googleapis.com/"
]
}
here's my picture.js file:
function show_image()
{
document.write("img src=picture.png");
}
and here's my audio.js file:
chrome.browserAction.onClicked.addListener(function(tab) {
var myAudio = new Audio();
myAudio.src = "audio.mp3";
myAudio.play();
});
when clicked, the sound will play, but the picture does not appear. Any ideas? Thanks!