ScriptsForMsDocToc

Sticky Microsoft Documents right sidebar TOC block

Versão de: 14/05/2022. Veja: a última versão.

// ==UserScript==
// @name         ScriptsForMsDocToc
// @namespace    mailto:[email protected]
// @version      0.5.0
// @license      MIT
// @description  Sticky Microsoft Documents right sidebar TOC block
// @description:zh 固定微软文档右侧的目录栏
// @author       fish-404
// @match        *://docs.microsoft.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    try { 
        document.getElementById("affixed-right-container").setAttribute("style", "position: sticky; top: 3vh");
        document.getElementById("right-rail-in-this-article-list").setAttribute("style", "overflow: auto; max-height: 70vh;");
        document.querySelector("button[data-bi-name='show-more-btn']").click();
        document.querySelector('#right-rail-in-this-article-list .is-expanded a').setAttribute("style", "outline: 0"); // remove dash border
    }
    catch {} // not all page has right sidebar TOC block
})();
长期地址
遇到问题?请前往 GitHub 提 Issues。