去nm的CSDN

CSDN纯享版

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        去nm的CSDN
// @description CSDN纯享版
// @license     MIT
// @namespace   zam157.csdnfucker
// @match       https://blog.csdn.net/*
// @grant       GM_addStyle
// @run-at      document-start
// @version     0.0.3
// @author      Zam157
// @homepageURL  https://github.com/zam157/tamper/tree/master/scripts/fck-csdn
// @supportURL   https://github.com/zam157/tamper/tree/master/scripts/fck-csdn
// ==/UserScript==

(function () {
  'use strict'
  const styles = `
    * {
      user-select: auto!important;
    }
    .passport-login-tip-container,
    .article-search-tip,
    .hljs-button,
    .blog_container_aside,
    .more-toolbar,
    .recommend-box,
    .passport-login-container,
    .article-info-box,
    .blog-footer-bottom,
    .hide-article-box,
    .sidecolumn-deepseek,
    .rightside-fixed-hide,
    a[data-type="app"],
    a[data-type="cs"],
    #blogColumnPayAdvert,
    #toolbarBox {
      display: none!important;
    }
    .nodata .container main {
      width: 100%;
    }
    .article_content {
      height: auto!important;
    }
    .d-flex.kind_person {
      display: none!important;
    }
  `
  GM_addStyle(styles)

  // 改写addEventListener,禁止注册copy事件
  const originalAEL = EventTarget.prototype.addEventListener
  EventTarget.prototype.addEventListener = function (...aelArgs) {
    // #region 禁止禁止复制
    if (aelArgs[0] === 'copy') {
      return
    }
    // #endregion

    // #region 禁止点击中转
    if (aelArgs[0] === 'click' && this.id === 'content_views') {
      function injectFn(...listenerArgs) {
        const e = listenerArgs[0]
        if (e.target.tagName === 'A')
          return
        aelArgs[1].apply(this, listenerArgs)
      }
      originalAEL.apply(this, [aelArgs[0], injectFn, aelArgs[2]])
      return
    }
    // #endregion

    originalAEL.apply(this, aelArgs)
  }
})()