Last active
September 30, 2020 16:57
-
-
Save asimihsan/b085adaf5fd577927faff796b9f4aa1f to your computer and use it in GitHub Desktop.
Greasemonkey script for forcefully enabling sidebar for Rust docs, even for narrow pages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Enable Sidebar for Rust docs | |
// @namespace https://asim.ihsan.io | |
// @version 0.1 | |
// @description Always enable sidebar on Rust documentation pages. | |
// @author Asim Ihsan. | |
// @match https://doc.rust-lang.org/* | |
// @grant none | |
// @run-at document-idle | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
document.querySelector('html').classList.replace("sidebar-hidden", "sidebar-visible"); | |
document.querySelector('html').style.setProperty("--sidebar-width", "15em"); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment