Skip to content

Instantly share code, notes, and snippets.

@zzmark
Last active October 28, 2019 07:03
Show Gist options
  • Save zzmark/9026e2ffaa8211ec1f110c6133aee4e8 to your computer and use it in GitHub Desktop.
Save zzmark/9026e2ffaa8211ec1f110c6133aee4e8 to your computer and use it in GitHub Desktop.
CSDN 博客自动展开"阅读更多"
// ==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("", "", "");
})();
@zzmark
Copy link
Author

zzmark commented Oct 10, 2019

v1.0.3

新增了 云栖社区

@zzmark
Copy link
Author

zzmark commented Oct 28, 2019

v1.0.4 修复了 csdn 复制失效

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment