Only When Sunday

🏖️ Redirects specific websites to WeRead.qq.com/web/shelf except sunday

目前為 2023-06-12 提交的版本,檢視 最新版本

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