Microsoft Doc Page Trimmer

A userscript to remove the sidebars and have adaptive scaling on Microsoft's documentation pages.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Microsoft Doc Page Trimmer
// @namespace    https://github.com/GemedetAdept/microsoft-docs-trimmer/
// @version      1.1
// @description  A userscript to remove the sidebars and have adaptive scaling on Microsoft's documentation pages.
// @author       https://github.com/GemedetAdept
// @match        *://learn.microsoft.com/*
// @icon         https://raw.githubusercontent.com/GemedetAdept/microsoft-docs-trimmer/main/resources/favicon.png
// @grant        GM_registerMenuCommand
// @license      GNU General Public License v3.0
// ==/UserScript==

var rightContainer = document.getElementById("ms--additional-resources");
rightContainer.remove();

var leftContainer = document.getElementById("left-container");
leftContainer.remove();

var primaryHolder = document.getElementsByClassName("primary-holder column is-two-thirds-tablet is-three-quarters-desktop")[0];
primaryHolder.classList.remove("column");
primaryHolder.classList.remove("is-two-thirds-tablet");
primaryHolder.classList.remove("is-three-quarters-desktop");

var columnHolder = document.getElementsByClassName("columns has-large-gaps is-gapless-mobile ")[0];
columnHolder.classList.add("column-holder");
columnHolder.classList.remove("columns");
columnHolder.classList.remove("has-large-gaps");
columnHolder.classList.remove("is-gapless-mobile");

var mainColumn = document.getElementById("main-column");
mainColumn.classList.remove("is-8-desktop");