Keep ShinyColors BGM

forked from https://github.com/biuuu/ShinyColors

目前為 2019-12-25 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name Keep ShinyColors BGM
  3. // @version 0.9.8
  4. // @description forked from https://github.com/biuuu/ShinyColors
  5. // @icon https://shinycolors.enza.fun/icon_192x192.png
  6. // @original_author biuuu
  7. // @author pikakolendo
  8. // @match https://shinycolors.enza.fun/*
  9. // @run-at document-end
  10. // @grant GM_xmlhttpRequest
  11. // @namespace https://greasyfork.org/users/428281
  12. // ==/UserScript==
  13.  
  14. (function () {
  15.  
  16. const keepBgm = () => {
  17. window.addEventListener('blur', function (e) {
  18. e.stopImmediatePropagation();
  19. }, false);
  20. document.addEventListener('visibilitychange', function (e) {
  21. e.stopImmediatePropagation();
  22. });
  23. };
  24.  
  25. keepBgm();
  26.  
  27. }());