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
- Get active tab URL
- How to execute content script after page content is loaded
- How to do a POST request
- How to simulate keypress/keyup/keydown event on a page
- How to add jQuery support to content script in Chrome extension.
- Get cookie value
- Manifest V3 example for Chrome extension.
- How to send message from content script to background script
- How to fetch data in content script
See more codes...