Only When Sunday

🏖️ Closes specific websites tabs except Sunday

当前为 2023-06-16 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Only When Sunday
  3. // @namespace https://github.com/mefengl
  4. // @author mefengl
  5. // @version 0.0.8
  6. // @description 🏖️ Closes specific websites tabs except Sunday
  7. // @match *://*/*
  8. // @grant none
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. (() => {
  13. 'use strict';
  14.  
  15. const websitesToClose = [
  16. 'bilibili.com',
  17. 'ddys.art',
  18. 'discord.com',
  19. 'greasyfork.org',
  20. 'outlook.live.com',
  21. 'spotify.com',
  22. 'twitter.com',
  23. 'weibo.com',
  24. 'weread.qq.com',
  25. 'youtube.com',
  26. ];
  27.  
  28. if (new Date().getDay() !== 0) {
  29. if (websitesToClose.some(website => window.location.href.includes(website))) {
  30. window.close();
  31. }
  32. }
  33. })();