Google calendar refresh

Refresh Google calendar when you click on it after it has been open since yesterday

目前为 2017-02-02 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Google calendar refresh
  3. // @namespace http://ostermiller.org/
  4. // @version 1.1
  5. // @description Refresh Google calendar when you click on it after it has been open since yesterday
  6. // @match *://calendar.google.com/calendar/render*
  7. // @copyright 2014-2017, Stephen Ostermiller
  8. // @grant none
  9. // ==/UserScript==
  10. var loaddate = new Date().toISOString().replace(/T.*/,"");
  11. //console.log("Loaded: " + loaddate);
  12. window.addEventListener("focus", function(event) {
  13. var nowdate = new Date().toISOString().replace(/T.*/,"");
  14. //console.log("Google calendar has focus -- Loaded: " + loaddate + " Now: " + nowdate);
  15. if (loadDate != nowdate) {
  16. //console.log("Refreshing Google calendar");
  17. location.reload();
  18. }
  19. }, false);