chrome-extensionHow to play sound
var sound = new Audio(chrome.runtime.getURL('sound.mp3'));
sound.play();ctrl + c
audio object to play mp3
get URL for public extension resource (mp3 file in our case)
file we want to play (should be located in extension folder and added to web_accessible_resources)
plays selected file
More of Chrome Extension
- How to add jQuery support to background script in Chrome extension.
- Get active tab ID
- How to listen for button click in popup script
- How to do a POST request
- How to add jQuery support to content script in Chrome extension.
- How to access page variables
- Manifest V3 example for Chrome extension.
- Inject CSS into page
See more codes...