Expand All Sections on Otolaryngology Core Curriculum

Expands all elements with class "expandable js-expandable" on learning module pages

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください。
// ==UserScript==
// @name         Expand All Sections on Otolaryngology Core Curriculum
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Expands all elements with class "expandable js-expandable" on learning module pages
// @match        https://occ.entnet.org/moduleContent.aspx*
// @grant        none
// @run-at       context-menu
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    function expandElements() {
        const expandableElements = document.querySelectorAll('.expandable.js-expandable');
        expandableElements.forEach(element => {
            element.classList.add('expanded');
        });
    }

    // Run the function immediately
    expandElements();

    // Also run the function periodically to catch dynamically added elements
    setInterval(expandElements, 2000);
})();