ScriptsForMsDocToc

Sticky Microsoft Documents right sidebar TOC block and click show more default

Od 14.05.2022.. Pogledajte najnovija verzija.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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         ScriptsForMsDocToc
// @namespace    mailto:[email protected]
// @version      0.5.0
// @license      MIT
// @description  Sticky Microsoft Documents right sidebar TOC block and click show more default
// @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
})();