Monkey Tab

Say monkey when opening a new tab

  1. // ==UserScript==
  2. // @name Monkey Tab
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Say monkey when opening a new tab
  6. // @match *://*/*
  7. // @grant none
  8. // ==/UserScript==
  9.  
  10. (function() {
  11. 'use strict';
  12.  
  13. // Check if the current tab is a new tab
  14. if (window.location.href === "about:blank") {
  15. // Create an audio element
  16. var audio = document.createElement("audio");
  17. // Set the source to a monkey sound
  18. audio.src = "https://freesound.org/data/previews/169/169731_3022696-lq.mp3";
  19. // Play the audio
  20. audio.play();
  21. // Display a message on the tab
  22. document.body.innerHTML = "<h1>Monkey!</h1>";
  23. }
  24. })();