No more inactive tabs

Adds a hidden audio file from 13MB that plays silence to the pages you visit. This will not work on mobile

  1. // ==UserScript==
  2. // @name No more inactive tabs
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Adds a hidden audio file from 13MB that plays silence to the pages you visit. This will not work on mobile
  6. // @author Don
  7. // @match *://*/*
  8. // @grant none
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. // Create the audio element
  16. var audioElement = document.createElement('audio');
  17. audioElement.src = 'https://raw.githubusercontent.com/KoboldAI/KoboldAI-Client/main/colab/silence.m4a';
  18. audioElement.controls = false;
  19. audioElement.autoplay = true; // Autoplay the audio
  20.  
  21. // Listen for the "canplay" event before playing
  22. audioElement.addEventListener('canplay', function() {
  23. audioElement.play(); // Attempt to play the audio
  24. });
  25.  
  26. // Append the audio element to the body of the page
  27. document.body.appendChild(audioElement);
  28. })();