VTC Moodle: Auto-hide Sidebar

Hide the sidebar automatically after the page loaded.

スクリプトをインストールするには、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               VTC Moodle: Auto-hide Sidebar
// @name:zh-TW         VTC Moodle:自動隱藏側邊欄
// @description        Hide the sidebar automatically after the page loaded.
// @description:zh-TW  在頁面載入後自動隱藏側邊欄。
// @icon               https://icons.duckduckgo.com/ip3/moodle2526.vtc.edu.hk.ico
// @author             Jason Kwok
// @namespace          https://jasonhk.dev/
// @version            1.0.0
// @license            MIT
// @match              https://moodle2526.vtc.edu.hk/*
// @run-at             document-end
// @grant              none
// @supportURL         https://greasyfork.org/scripts/551368/feedback
// ==/UserScript==

const body = document.body;
const toggle = document.querySelector(".tgsdbb_toggle");
if (toggle)
{
    const interval = setInterval(() =>
    {
        if (!body.classList.contains("tgsdbb_open"))
        {
            clearInterval(interval);
            return;
        }

        toggle.click();
    }, 50);
}