去掉doc88,360doc,csdn和sfgg的登陆后复制限制

各大站都搞这个登陆复制,真的恶心,

尤其是csdn,各种和谐,

虽然有命令,但是每次敲都贼麻烦,

来个油猴脚本吧~~

/* eslint-disable no-undef */
/* eslint-disable no-eval */
// ==UserScript==
// @name         去掉doc88,360doc,csdn和segmentfault的登陆后复制限制
// @author       ALEX.XU
// @version      1.0.0
// @match        *://*/*
// @require      https://cdn.bootcdn.net/ajax/libs/jquery/1.9.1/jquery.min.js
// @run-at       document-start
// @grant        unsafeWindow
// ==/UserScript==
(function() {
  'use strict';
  $(function(){
    if (/www.doc88.com/.test(location.href) || /www.360doc.com/.test(location.href)){
      function oncopy() {
        return true;
      }
      setInterval(function(){
      try{
        unsafeWindow.logined = 1
        unsafeWindow.u_v = 1
        document.body.oncopy = oncopy //360doc
      }catch(e){
        console.log(e)}
      }, 1000)
    }else if(/blog.csdn.net/.test(location.host)){
      console.log(mdcp, hljs);
      if (typeof(mdcp)!="undefined" && 'copyCode' in mdcp){
        // $("code").attr("onclick","mdcp.copyCode(event)")
        // 直接来个狠的
        document.body.contentEditable = true;
      }else if (typeof(hljs)!="undefined" && 'copyCode' in hljs){
        $("*").one("mousemove", function(){
          $(".hljs-button").attr("onclick","hljs.copyCode(event)")
        })
      }
    } else if(/segmentfault.com/.test(location.host)){
      $("<div></div>").attr("id","SFUserId").appendTo("body")
    }
  })
}())