Microsoft Doc Page Trimmer

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

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 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");