Greasy Fork

copyright

去除所有网站小尾巴数据,csdn未登陆自动阅读更多

目前为 2018-11-04 提交的版本。查看 最新版本

// ==UserScript==
// @name         copyright
// @namespace    http://tampermonkey.net/
// @version      2.0
// @description  去除所有网站小尾巴数据,csdn未登陆自动阅读更多
// @author       You
// @match        *://*/*
// @grant        none
// ==/UserScript==

(function () {
  'use strict';

  [].slice.call(document.getElementsByTagName('*')).forEach((ele) => {
    ele.addEventListener("copy", function (t) {
      t.clipboardData.setData("text", getMySelection())
      t.preventDefault()
    })
  })

  function getMySelection() {
    let e = window.getSelection().getRangeAt(0).cloneContents().textContent
    return e
  }

  let host = window.location.host
  if (host === 'www.jianshu.com') {
    // M.copyright.config = {}
  } else {
    // csdn.copyright.init($("article")[0], '', '');
    $('#btn-readmore').click()
  }
})();