Skip to content

Instantly share code, notes, and snippets.

@codethereforam
Created June 8, 2023 09:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codethereforam/fe5b50b4e70414602d2b7a600055ae37 to your computer and use it in GitHub Desktop.
Save codethereforam/fe5b50b4e70414602d2b7a600055ae37 to your computer and use it in GitHub Desktop.
简书专注模式[油猴脚本]
// ==UserScript==
// @name 简书专注模式
// @namespace https://github.com/codethereforam/
// @version 0.1
// @description 去除简书一切不必要的页面元素
// @author https://github.com/codethereforam/
// @match https://*.jianshu.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=jianshu.com
// @grant none
// ==/UserScript==
(function() {
'use strict';
const main = document.querySelector('[role="main"]').children[0].children[0];
document.body.innerHTML = "";
document.body.appendChild(main);
document.body.style = "padding-right: 20%;padding-left: 20%;"
// 解决图片无法加载问题
for (const img of document.querySelectorAll("img")) {
img.src = img.getAttribute("data-original-src");
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment