Remove scrollbar-color for Notion

Remove scrollbar-color from Notion pages,ths Chatgpt.

ของเมื่อวันที่ 20-09-2024 ดู เวอร์ชันล่าสุด

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey, Greasemonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Remove scrollbar-color for Notion
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Remove scrollbar-color from Notion pages,ths Chatgpt.
// @author       Jw
// @match        https://www.notion.so/*
// @grant        none
// @license   MIT
// ==/UserScript==

(function() {
    'use strict';

    // 遍历所有的样式表
    for (let i = 0; i < document.styleSheets.length; i++) {
        const styleSheet = document.styleSheets[i];

        try {
            const rules = styleSheet.cssRules || styleSheet.rules;
            if (!rules) continue;

            // 遍历每条样式规则
            for (let j = 0; j < rules.length; j++) {
                const rule = rules[j];

                if (rule.style && rule.style.scrollbarColor) {
                    rule.style.scrollbarColor = "";  // 移除 scrollbar-color
                }
            }
        } catch (e) {
            console.log('Error accessing stylesheet:', e);
        }
    }
})();