Guest User

Untitled

a guest
Jun 18th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. var audio = new Audio("alarm.wav");
  2. audio.play();
  3.  
  4. document.write('<audio id="player" src="alarm.wav" >');
  5. document.getElementById('player').play();
  6.  
  7. {
  8. "name": "Alarm",
  9. "version": "1.0.0",
  10. "icons": {"64": "icon64.png"},
  11. "permissions": [
  12. "http://site1/",
  13. "http://site2/"
  14. ],
  15. "content_scripts": [
  16. {
  17. "matches": ["http://site1/", "http://site2/"],
  18. "js": ["myscript.js"],
  19. "run_at": "document_end"
  20. }
  21. ],
  22. "manifest_version": 2
  23. }
  24.  
  25. var myAudio = new Audio();
  26. myAudio.src = "alarm.mp3";
  27. myAudio.play();
  28.  
  29. var myAudio = new Audio(); // create the audio object
  30. myAudio.src = "path/to/file.mp3"; // assign the audio file to its src
  31. myAudio.play(); // play the music
Add Comment
Please, Sign In to add comment