Redditblock

Redirects people back to what they were doing before they decided to browse Reddit from 9 AM to 7 PM inclusive.

当前为 2015-11-21 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Redditblock
  3. // @description Redirects people back to what they were doing before they decided to browse Reddit from 9 AM to 7 PM inclusive.
  4. // @include https://*.reddit.com
  5. // @include https://*.reddit.com/*
  6. // @run-at document-start
  7. // @version 0.0.1.20151121234916
  8. // @namespace https://greasyfork.org/users/12417
  9. // ==/UserScript==
  10.  
  11. // This whole code is meant to block Reddit from 7 AM to 6 PM
  12.  
  13. // For any further inquiries, please tell me at scratch.mit.edu/users/iamunknown2 or reddit/u/iamunknowntwo
  14. var date1 = new Date();
  15. var hours = date1.getHours();
  16. var day = date1.getDay();
  17.  
  18.  
  19. if (hours >= 8 && hours <= 17 && day != 0 && day != 6) // If hours are 7 AM to 6 PM (inclusive) and not a weekend
  20. {
  21. window.history.back(); // Get back to your work.
  22. }