调整鸿蒙OS文档的侧边目录的宽度
// ==UserScript==
// @name 鸿蒙文档 侧边目录宽度调整
// @namespace http://tampermonkey.net/
// @version 0.3
// @description 调整鸿蒙OS文档的侧边目录的宽度
// @author Asjun
// @match https://developer.harmonyos.com/cn/docs/*
// @icon https://www.google.com/s2/favicons?domain=harmonyos.com
// @grant none
// ==/UserScript==
(function() {
'use strict';
setTimeout(function() { setWidth(); }, 2000);
})();
function setWidth() {
if (document.querySelector("#documentMenu") == undefined) {
return;
}
var width = '216px';
var node = document.querySelector("#auiAnchorTarget > div > app-document-page > div:nth-child(1) > nz-layout > nz-sider.left-sider.ant-layout-sider");
node.style.minWidth = width;
node.style.maxWidth = width;
node.style.width = width;
node = document.querySelector("#documentMenu");
node.style.width =width;
node = document.querySelector("#documentMenu > div");
node.style.marginLeft='16px';
node = document.querySelector("#auiAnchorTarget > div > app-document-page > div:nth-child(1) > nz-layout > nz-content > div");
node.style.marginLeft = '32px';
node.style.marginRight = '32px';
}