Hobbs2000 Hobbs2000 - 1 month ago 5
Javascript Question

Is there an audio web_accessible_resource for Chrome extensions?

I want to be able to insert audio into a webpage via a Chrome extension. I know that to do this with images you must add

to the
list in the manifest. However, after some searching online, there does not appear to be an equivalent of this for sound files. So, how would I insert audio to a webpage with my chrome extension?


There is no restriction that prevents you from including you audio files in the web_accessible_resources list in your manifest.json. That list can contain whatever resources you want to make accessible to content pages.

For example, if you want to make all files in your myAudioFileDirectory folder available in addition to some file called bogusFileName.foobar you could include them as:

"web_accessible_resources": [

When you include "images/my-image-file" (as mentioned in your question), the fact that the images are in a directory called images is merely organization which you have chosen to use within your extension. It is not required that all images be placed in a directory called images. That is just the way it is commonly done, particularly in examples.