Last active
October 28, 2019 07:03
-
-
Save zzmark/9026e2ffaa8211ec1f110c6133aee4e8 to your computer and use it in GitHub Desktop.
CSDN 博客自动展开"阅读更多"
This file contains 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 CSDN自动展开+净化剪切板 | |
// @namespace https://gist.github.com/ZzMark/9026e2ffaa8211ec1f110c6133aee4e8 | |
// @version 1.0.3 | |
// @description 清理csdn的展开,不需要登录,顺便清理了剪切板 | |
// @author Zhou | |
// @match *://blog.csdn.net/*/article/details/* | |
// @match *://bbs.csdn.net/topics/* | |
// @match *://www.fangzhipeng.com/* | |
// @match *://yq.aliyun.com/articles/* | |
// @icon https://csdnimg.cn/public/favicon.ico | |
// @grant none | |
// @run-at document-end | |
// ==/UserScript== | |
(function () { | |
'use strict'; | |
var removeElement = function (elements) { | |
var parent = elements.parentElement | |
parent.removeChild(elements) | |
} | |
var currentURL = window.location.href | |
// 自动展开: | |
// CSDN: | |
// 清除 #article_content 的 style | |
setTimeout(function() { | |
var content = document.getElementById('article_content') | |
content && (content.style = '') | |
// 删除按钮 | |
var btn = document.getElementsByClassName('hide-article-box')[0] | |
btn && removeElement(btn) | |
}, 100) | |
// fangzhipeng: | |
setTimeout(function() { | |
var content = document.getElementById('locker') | |
content && (content.style = '') | |
// 删除按钮 | |
var btn = document.getElementById('unlockReadall') | |
btn && removeElement(btn) | |
}, 100) | |
// 云栖社区 | |
setTimeout(function() { | |
var content = document.getElementsByClassName('article-hide-content')[0] | |
content && (content.style = '') | |
// 删除按钮 | |
var btn = document.getElementsByClassName('article-hide-box')[0] | |
btn && removeElement(btn) | |
}, 100) | |
// 去除剪贴板劫持 | |
window.csdn && window.csdn.copyright.init("", "", ""); | |
})(); |
v1.0.3
新增了 云栖社区
v1.0.4 修复了 csdn 复制失效
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
v1.0.2
新增了 fangzhipeng 网站