CSDN复制解禁

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

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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)
})();