Skip to content

Instantly share code, notes, and snippets.

@hochun836
Created March 17, 2025 01:13
Show Gist options
  • Save hochun836/19d62dd473049ba2e892f5e671942a4d to your computer and use it in GitHub Desktop.
Save hochun836/19d62dd473049ba2e892f5e671942a4d to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Style Microsoft documents
// @namespace https://hochun836.com/
// @version 0.1
// @description enhance experience of reading Microsoft documents
// @author Ho.Chun
// @match https://learn.microsoft.com/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// ==/UserScript==
(function() {
'use strict';
// 變更 .content 下的 h2 元素
document.querySelectorAll('.content h2').forEach(x => {
x.innerText = `${x.innerText}`;
x.style.backgroundColor = '#ffeaf2';
});
// 變更 .content 下的 h3 元素
document.querySelectorAll('.content h3').forEach(x => {
x.innerText = `● ${x.innerText}`;
});
// 變更 .content 下的 h4 元素
document.querySelectorAll('.content h4').forEach(x => {
x.innerText = `o ${x.innerText}`;
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment