Google calendar refresh

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

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

You will need to install an extension such as Tampermonkey to install this script.

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name       Google calendar refresh
// @namespace  http://ostermiller.org/
// @version    1.2
// @description  Refresh Google calendar when you click on it after it has been open since yesterday
// @match      *://calendar.google.com/calendar/render*
// @copyright  2014-2017, Stephen Ostermiller
// @grant none
// ==/UserScript==
var loaddate = new Date().toISOString().replace(/T.*/,"");
//console.log("Loaded: " + loaddate);
window.addEventListener("focus", function(event) {
    var nowdate = new Date().toISOString().replace(/T.*/,"");
    //console.log("Google calendar has focus -- Loaded: " + loaddate + " Now: " + nowdate);
    if (loaddate != nowdate) {
        //console.log("Refreshing Google calendar");
        location.reload();
    }
}, false);