Last active
June 7, 2024 11:36
-
-
Save imyelo/7a560234ed1227028053ebe18342ac62 to your computer and use it in GitHub Desktop.
UserScript - LogSeq Print Mode
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 LogSeq Print Mode | |
// @description Logseq 打印模式 | |
// @version 0.2 | |
// @author yelo <[email protected]> | |
// @match https://**/** | |
// @grant GM_registerMenuCommand | |
// @run-at document-start | |
// @require https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js | |
// ==/UserScript== | |
/* global $ */ | |
(function() { | |
'use strict'; | |
const clean = () => { | |
$("html").css("overflow", "auto"); | |
$("#head").remove(); | |
$("#left-sidebar").remove(); | |
$("#main-content").removeClass("is-left-sidebar-open"); | |
$("#left-container").css("height", "auto"); | |
$('.block-content img').css('max-width', 400); | |
}; | |
GM_registerMenuCommand( | |
"进入打印模式", | |
async () => { | |
clean(); | |
}, | |
{ | |
accessKey: "p", | |
autoClose: true, | |
} | |
); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment