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
- Get active tab ID
- How to add jQuery support to content script in Chrome extension.
- How to do a POST request
- How to execute content script after page content is loaded
- How to simulate keypress/keyup/keydown event on a page
- How to listen for button click in popup script
- How to fetch data in content script
- How to simulate mouse over event on a page
- Manifest V3 example for Chrome extension.
- How to access page variables
See more codes...