CSDN复制解禁

随意在CSDN复制带样式的文本,不受到其自身版权限制脚本的影响

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         CSDN复制解禁
// @name:en      CSDN enable code copy
// @namespace    http://blog.csdn.net/
// @version      0.1
// @description  随意在CSDN复制带样式的文本,不受到其自身版权限制脚本的影响
// @description:en  Copy styled text on CSDN,do whatever you want, without being affected by its own copyright-restricted scripts.
// @author       AIUSoft
// @license      MIT
// @supportURL   https://gist.github.com/LiuQixuan/7a8683ede4b885a6df834ceeb933d1c5
// @match        https://blog.csdn.net/*
// @icon         https://www.google.com/s2/favicons?domain=csdn.net
// @grant        none
// @run-at document-end
// ==/UserScript==
/* jshint esversion: 6 */

(function() {
    'use strict';
    document.getElementById('content_views')?.setAttribute('id','')
    document.getElementById('article_content')?.setAttribute('id','')
    document.querySelectorAll('.set-code-hide').forEach(el=>el.classList.remove('set-code-hide'))
    document.querySelectorAll('.hide-preCode-box').forEach(el=>el.remove())
    document.querySelectorAll('.signin').forEach(el=>el.remove())
    let contentEl = document.querySelector('main .blog-content-box')
    contentEl.parentNode.replaceChild(contentEl.cloneNode(1), contentEl)
})();