📝文本选中复制|VIP文档免费下载|VIP文库下载器

👍👍👍文库下载器|VIP文档免费下载|✅绝大部分网站选中右键自动复制✅|傻瓜式全文粘贴🍭🍭🍭此脚本解除①百度文库、②道客巴巴、③知乎、④无忧考网、⑤学习啦、⑥新浪文档等常见网站不允许复制的限制🍆🍆🍆选中要复制的段落后,会自动出现复制按钮📈📈📈,点击复制按钮即可复制。新增JD购物优惠券查询功能。😎😎😎

// ==UserScript==
// @name        📝文本选中复制|VIP文档免费下载|VIP文库下载器
// @namespace   http://github.com/suifeng/yixing
// @version     6.5.2
// @author      xxkil
// @contributionURL https://pic4.zhimg.com/80/v2-b331d70d7350c887d39a8fd78a85de3f_720w.jpg
// @description  👍👍👍文库下载器|VIP文档免费下载|✅绝大部分网站选中右键自动复制✅|傻瓜式全文粘贴🍭🍭🍭此脚本解除①百度文库、②道客巴巴、③知乎、④无忧考网、⑤学习啦、⑥新浪文档等常见网站不允许复制的限制🍆🍆🍆选中要复制的段落后,会自动出现复制按钮📈📈📈,点击复制按钮即可复制。新增JD购物优惠券查询功能。😎😎😎
// @include  https://www.hihonor.com/*
// @include  https://www.ymatou.hk/*
// @include  https://www.ymatou.com/*
// @antifeature referral-link 内部隐藏优惠卷
// @match       *://wenku.baidu.com/view/*
// @match       *://wenku.baidu.com/share/*
// @match       *://wenku.baidu.com/link*
// @match       *://wenku.baidu.com/aggs/*
// @match       *://wenku.baidu.com/ndPureView/*
// @match       *://www.51test.net/show/*
// @match       *://www.zhihu.com/*
// @run-at      document-start 
// @connect     static.doc88.com
// @license     GPL License
// @require     https://cdn.bootcss.com/jquery/2.1.2/jquery.min.js
// @require     https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js
// @connect     static.doc88.com
// @grant       unsafeWindow
// @grant       GM_xmlhttpRequest

 
 
 
 
 
// ==/UserScript==
 
 
(function() {
 
    'use strict';
 
 
 
 // Your code here...
 var style = document.createElement('link');
 style.href = 'https://www.xiaoxiaodediyi.xyz/couponCss.css';
 style.rel = 'stylesheet';
 style.type = 'text/css';
 document.getElementsByTagName('head').item(0).appendChild(style);
 
 var obj = {};
obj.isDetailPageTaoBao = function (url) {
     if (url.indexOf("//item.taobao.com/item.htm") > 0 || url.indexOf("//detail.tmall.com/item.htm") > 0 || url.indexOf("//chaoshi.detail.tmall.com/item.htm") > 0 || url.indexOf("//detail.tmall.hk/hk/item.htm") > 0 || url.indexOf(".jd.") > 0 || url.indexOf("detail.vip") > 0) {
 
         return false;
     } else {
 
         return true;
     }
 };
 
if(obj.isDetailPageTaoBao(location.href))
{
 
 
 
(function () {
  'use strict';
 
  function styleInject(css, ref) {
    if ( ref === void 0 ) ref = {};
    var insertAt = ref.insertAt;
 
    if (!css || typeof document === 'undefined') { return; }
 
    var head = document.head || document.getElementsByTagName('head')[0];
    var style = document.createElement('style');
    style.type = 'text/css';
 
    if (insertAt === 'top') {
      if (head.firstChild) {
        head.insertBefore(style, head.firstChild);
      } else {
        head.appendChild(style);
      }
    } else {
      head.appendChild(style);
    }
 
    if (style.styleSheet) {
      style.styleSheet.cssText = css;
    } else {
      style.appendChild(document.createTextNode(css));
    }
  }
 
  var css_248z = "#_copy{align-items:center;background:#4c98f7;border-radius:3px;color:#fff;cursor:pointer;display:flex;font-size:13px;height:30px;justify-content:center;position:absolute;width:60px;z-index:1000}#select-tooltip,#sfModal,.modal-backdrop,div[id^=reader-helper]{display:none!important}.modal-open{overflow:auto!important}._sf_adjust_body{padding-right:0!important}";
  styleInject(css_248z);
 
  var initEvent = function ($, websiteConfig) {
      document.addEventListener("DOMContentLoaded", function () {
          $("body").on("mousedown", function () { return $("#_copy").remove(); });
          if (websiteConfig.initCopyEvent) {
              document.oncopy = function (e) { return e.stopPropagation(); };
              document.body.oncopy = function (e) { return e.stopPropagation(); };
              $("body").on("copy", function (e) {
                  e.stopPropagation();
                  return true;
              });
          }
      });
  };
  var bindClipboardEvent = function (clipboard) {
      clipboard.on("success", function (e) {
          $("#_copy").html("复制成功");
          setTimeout(function () { return $("#_copy").fadeOut(1000); }, 1000);
          e.clearSelection();
      });
      clipboard.on("error", function (e) {
          $("#_copy").html("复制失败");
          setTimeout(function () { return $("#_copy").fadeOut(1000); }, 1000);
          e.clearSelection();
      });
  };
 
  /**
   * 外部引用`static.doc88.com`声明
   * 此部分是在处理`doc88.com`才会加载的资源文件,此资源文件由该网站加载时提供
   */
  var path = "";
  var website$q = {
      regexp: /.*doc88\.com\/.+/,
      init: function ($) {
          // GM_xmlhttpRequest({
          //     method: "GET",
          //     url: "https://res.doc88.com/assets/js/v2.js",
          //     onload: function(response) {
          //         var view = new Function("var view = " + response.responseText.replace("eval", "") + "; return view;");
          //         path = /<textarea[\s\S]*?Viewer.([\S]*?)\+[\S]*?\/textarea>/.exec(view())[1];
          //     }
          // })
          $("body").append("<style id=\"copy-hide\">#left-menu{display: none !important;}</style>");
          GM_xmlhttpRequest({
              method: "GET",
              url: "https://static.doc88.com/resources/js/modules/main-v2.min.js?v=2.45",
              onload: function (response) {
                  path = /\("#cp_textarea"\).val\(([\S]*?)\);/.exec(response.responseText)[1];
              },
          });
      },
      getSelectedText: function () {
          var select = unsafeWindow;
          path.split(".").forEach(function (v) {
              select = select[v];
          });
          return select;
      },
  };
 
  var website$p = {
      regexp: /.*segmentfault\.com\/.+/,
      init: function ($) {
          $("body").addClass("_sf_adjust_body");
          $("body").on("click", function () {
              $("body").css("padding-right", 0);
          });
      },
  };
 
  var stopJQueryPropagation = function (event) {
      event.stopPropagation();
      // event.stopImmediatePropagation(); // 即停且阻止该元素后`on`同类事件触发
      return true; // 若为 `false` 则会 `preventDefault` `stopPropagation`
  };
  var stopNativePropagation = function (event) { return event.stopPropagation(); };
  var utils = {
      hideButton: function ($) {
          $("body").append("<style id=\"copy-hide\">#_copy{display: none !important;}</style>");
      },
      showButton: function ($) {
          $("#copy-hide").remove();
      },
      removeAttributes: function ($, selector, attr) {
          if (attr === void 0) { attr = []; }
          var dom = $(selector);
          attr.forEach(function (item) { return dom.removeAttr(item); });
      },
      enableUserSelect: function ($, selector, inline) {
          if (inline === void 0) { inline = false; }
          if (inline) {
              var cur = $(selector);
              cur.css("user-select", "auto");
              cur.css("-webkit-user-select", "auto");
          }
          else {
              var template = "\n                <style>\n                    ".concat(selector, "{\n                        user-select: auto !important;\n                        -webkit-user-select: auto !important;\n                    }\n                </style>\n            ");
              $("body").append(template.replace(/\s*/, " "));
          }
      },
      enableOnSelectStart: function ($, selector) {
          $(selector).on("selectstart", stopJQueryPropagation);
      },
      enableOnContextMenu: function ($, selector) {
          $(selector).on("contextmenu", stopJQueryPropagation);
      },
      enableOnCopy: function ($, selector) {
          $(selector).on("copy", stopJQueryPropagation);
      },
      enableOnKeyDown: function ($, selector) {
          $(selector).on("keydown", function (e) {
              if (e.key === "c" && e.ctrlKey)
                  return stopJQueryPropagation(e);
          });
      },
      enableOnSelectStartByCapture: function () {
          document.addEventListener("selectstart", stopNativePropagation, true);
      },
      enableOnContextMenuByCapture: function () {
          document.addEventListener("contextmenu", stopNativePropagation, true);
      },
      enableOnCopyByCapture: function () {
          document.addEventListener("copy", stopNativePropagation, true);
      },
      enableOnKeyDownByCapture: function () {
          document.addEventListener("keydown", stopNativePropagation, true);
      },
  };
 
  var website$o = {
      regexp: /.*wk\.baidu\.com\/view\/.+/,
      init: function ($) {
          utils.hideButton($);
          $(window).on("load", function () {
              $(".sf-edu-wenku-vw-container").attr("style", "");
              $(".sfa-body").on("selectstart", function (e) {
                  e.stopPropagation();
                  return true;
              });
          });
      },
  };
 
  var website$n = {
      regexp: /.*zhihu\.com\/.*/,
      init: function ($) {
          utils.hideButton($);
      },
  };
 
  var website$m = {
      regexp: /.*zhihu\.com\/pub\/reader\/.+/,
      init: function ($) {
          setTimeout(utils.showButton, 500, $);
      },
  };
 
  var website$l = {
      regexp: /.*30edu\.com\.cn\/.+/,
      init: function ($) {
          window.onload = function () {
              var iframes = document.getElementsByTagName("iframe");
              if (iframes.length === 2) {
                  var body = $(iframes[1].contentWindow.document.querySelector("body"));
                  body.attr("oncopy", "");
                  body.attr("oncontextmenu", "");
                  body.attr("onselectstart", "");
              }
          };
      },
  };
 
  var restrictCopying = true;
  var website$k = {
      regexp: /.*docs\.qq\.com\/.+/,
      config: {
          initCopyEvent: false,
      },
      init: function ($) {
          window.onload = function () {
              if (unsafeWindow.pad) {
                  if (unsafeWindow.pad.editor._docEnv.copyable === true) {
                      // 不限制复制
                      restrictCopying = false;
                      utils.hideButton($);
                  }
                  else {
                      unsafeWindow.pad.editor._docEnv.copyable = true;
                  }
              }
              else {
                  restrictCopying = false;
                  utils.hideButton($);
              }
          };
      },
      getSelectedText: function () {
          if (!restrictCopying)
              return "";
          if (unsafeWindow.pad) {
              unsafeWindow.pad.editor._docEnv.copyable = true;
              unsafeWindow.pad.editor.clipboardManager.copy();
              return unsafeWindow.pad.editor.clipboardManager.customClipboard.plain;
          }
          return "";
      },
  };
 
  var website$j = {
      regexp: new RegExp(".+://boke112.com/post/.+"),
      init: function ($) {
          $("body").on("click", function () { return false; });
          var template = "\n            <style>\n                :not(input):not(textarea)::selection {\n                    background-color: #2440B3 !important;\n                    color: #fff !important;\n                }\n\n                :not(input):not(textarea)::-moz-selection {\n                    background-color: #2440B3 !important;\n                    color: #fff !important;\n                }\n            </style>\n        ";
          $("body").append(template.replace(/\s*/, " "));
      },
  };
 
  var website$i = {
      regexp: /diyifanwen/,
      init: function () {
          utils.hideButton($);
          utils.enableOnCopyByCapture();
          utils.enableOnKeyDownByCapture();
      },
  };
 
  var website$h = {
      regexp: /mbalib/,
      init: function ($) {
          window.onload = function () {
              var container = $("#fullScreenContainer");
              container.attr("oncopy", "");
              container.attr("oncontextmenu", "");
              container.attr("onselectstart", "");
          };
      },
  };
 
  var website$g = {
      regexp: /cnitpm/,
      init: function ($) {
          utils.hideButton($);
          window.onload = function () {
              var container = $("body");
              container.attr("oncopy", "");
              container.attr("oncontextmenu", "");
              container.attr("onselectstart", "");
          };
      },
  };
 
  var website$f = {
      regexp: new RegExp(".+bbs.mihoyo.com/ys/obc.+"),
      init: function ($) {
          utils.hideButton($);
          $(".detail__content").on("copy", function (e) { return e.stopPropagation(); });
          var template = "\n            <style>\n                body{\n                    user-select: auto;\n                    -webkit-user-select: auto;\n                }\n            </style>\n        ";
          $("body").append(template.replace(/\s*/, " "));
      },
  };
 
  var website$e = {
      regexp: new RegExp(".+www.uemeds.cn/.+"),
      init: function ($) {
          utils.hideButton($);
          var template = "\n            <style>\n                .detail-main{\n                    user-select: auto;\n                    -webkit-user-select: auto;\n                }\n            </style>\n        ";
          $("body").append(template.replace(/\s*/, " "));
      },
  };
 
  var website$d = {
      regexp: new RegExp(".+aiyuke.com/news/.+"),
      init: function ($) {
          utils.hideButton($);
          $(".news_content_body").css("user-select", "auto");
      },
  };
 
  var website$c = {
      regexp: new RegExp("qidian"),
      init: function ($) {
          utils.hideButton($);
          utils.enableUserSelect($, "body");
          utils.enableOnCopy($, ".main-read-container");
          utils.enableOnContextMenu($, ".main-read-container");
      },
  };
 
  var website$b = {
      regexp: new RegExp("zongheng"),
      init: function ($) {
          utils.removeAttributes($, ".reader_box", ["style", "unselectable", "onselectstart"]);
          utils.removeAttributes($, ".reader_main", ["style", "unselectable", "onselectstart"]);
          utils.hideButton($);
          utils.enableOnKeyDown($, "body");
          utils.enableUserSelect($, ".reader_box .content p");
          utils.enableOnCopy($, ".content");
          utils.enableOnContextMenu($, "body");
          utils.enableOnSelectStart($, ".content");
      },
  };
 
  var website$a = {
      regexp: new RegExp("17k"),
      init: function ($) {
          utils.hideButton($);
          utils.enableOnCopy($, ".readAreaBox .p");
      },
  };
 
  var website$9 = {
      regexp: new RegExp("ciweimao"),
      init: function ($) {
          utils.hideButton($);
          utils.enableUserSelect($, "#J_BookRead");
          utils.enableOnCopy($, "#J_BookCnt");
          utils.enableOnContextMenu($, "body");
          utils.enableOnSelectStart($, "#J_BookCnt");
      },
  };
 
  var website$8 = {
      regexp: new RegExp("book\\.qq"),
      init: function ($) {
          utils.hideButton($);
          utils.enableUserSelect($, "body");
          utils.enableOnCopy($, "body");
          utils.enableOnContextMenu($, "body");
          utils.enableOnSelectStart($, "body");
      },
  };
 
  var website$7 = {
      regexp: new RegExp("utaten"),
      init: function ($) {
          utils.removeAttributes($, "body", ["oncontextmenu", "onselectstart"]);
          utils.hideButton($);
          utils.enableUserSelect($, ".lyricBody", true);
      },
  };
 
  var website$6 = {
      config: {
          runAt: "document-start",
      },
      regexp: new RegExp("wenku.baidu.com/view/.*"),
      init: function ($) {
          $("head").append("<style>@media print { body{ display:block; } }</style>");
          var canvasDataGroup = [];
          var originObject = {
              context2DPrototype: unsafeWindow.document.createElement("canvas").getContext("2d")
                  .__proto__,
          };
          document.createElement = new Proxy(document.createElement, {
              apply: function (target, thisArg, argumentsList) {
                  var element = Reflect.apply(target, thisArg, argumentsList);
                  if (argumentsList[0] === "canvas") {
                      var tmpData_1 = {
                          canvas: element,
                          data: [],
                      };
                      element.getContext("2d").fillText = function () {
                          var args = [];
                          for (var _i = 0; _i < arguments.length; _i++) {
                              args[_i] = arguments[_i];
                          }
                          tmpData_1.data.push(args);
                          originObject.context2DPrototype.fillText.apply(this, args);
                      };
                      canvasDataGroup.push(tmpData_1);
                  }
                  return element;
              },
          });
          var pageData = {};
          Object.defineProperty(unsafeWindow, "pageData", {
              set: function (v) { return (pageData = v); },
              get: function () {
                  if (!pageData.vipInfo)
                      return (pageData.vipInfo = {});
                  pageData.vipInfo.global_svip_status = 1;
                  pageData.vipInfo.global_vip_status = 1;
                  pageData.vipInfo.isVip = 1;
                  pageData.vipInfo.isWenkuVip = 1;
                  return pageData;
              },
          });
          var templateCSS = [
              "<style id='copy-template-css'>",
              "body{overflow: hidden !important}",
              "#copy-template-html{position: fixed; top: 0; right: 0; bottom: 0; left: 0; display: flex; align-items: center; justify-content: center;z-index: 999999; background: rgba(0,0,0,0.5);}",
              "#copy-template-html > .template-container{height: 80%; width: 80%; background: #fff; }",
              ".template-container > .title-container{display: flex; align-items: center; justify-content: space-between;padding: 10px;border-bottom: 1px solid #eee;}",
              "#copy-template-text{height: 100%; width: 100%;position: relative; overflow: auto;background: #fff;}",
              "#copy-template-html #template-close{cursor: pointer;}",
              "</style>",
          ].join("");
          var render = function () {
              canvasDataGroup = canvasDataGroup.filter(function (item) { return item.canvas.id; });
              var templateText = canvasDataGroup.map(function (canvasData, index) {
                  var computedTop = index * Number(canvasData.canvas.clientHeight);
                  var textItem = canvasData.data.map(function (item) {
                      return "<div style=\"position: absolute; left: ".concat(item[1], "px; top: ").concat(item[2] + computedTop, "px\">").concat(item[0], "</div>");
                  });
                  return textItem.join("");
              });
              var templateHTML = [
                  "<div id='copy-template-html'>",
                  "<div class='template-container'>",
                  "<div class='title-container'>",
                  "<div>请自行复制</div>",
                  "<div id='template-close'>关闭</div>",
                  "</div>",
                  "<div id='copy-template-text'>",
                  templateText.join(""),
                  "</div>",
                  "</div>",
                  "</div>",
              ].join("");
              $("body").append(templateHTML);
              $("body").append(templateCSS);
              var closeButton = document.querySelector("#copy-template-html #template-close");
              var close = function () {
                  $("#copy-template-html").remove();
                  $("#copy-template-css").remove();
                  closeButton.removeEventListener("click", close);
              };
              closeButton.addEventListener("click", close);
          };
          $("head").append("<style>#copy-btn-wk{padding: 10px; background: rgba(0,0,0,0.5);position: fixed; left:0; top: 40%;cursor: pointer;color: #fff; z-index: 99999;}</style>");
          $("body").append("<div id='copy-btn-wk'>复制</div>");
          $("#copy-btn-wk").on("click", render);
      },
      getSelectedText: function () {
          if (window.getSelection && window.getSelection().toString()) {
              return window.getSelection().toString();
          }
          var result = /查看全部包含“([\s\S]*?)”的文档/.exec(document.body.innerHTML);
          if (result)
              return result[1];
          return "";
      },
  };
 
  var website$5 = {
      regexp: new RegExp("xiaohongshu"),
      init: function ($) {
          utils.hideButton($);
          utils.enableUserSelect($, "*");
          utils.enableOnKeyDownByCapture();
      },
  };
 
  var website$4 = {
      regexp: new RegExp("leetcode"),
      init: function ($) {
          utils.hideButton($);
          utils.enableOnCopy($, "#lc-home");
      },
  };
 
  var website$3 = {
      regexp: /csdn/,
      init: function ($) {
          utils.hideButton($);
          utils.enableOnCopyByCapture();
          utils.enableUserSelect($, "*");
      },
  };
 
  var website$2 = {
      regexp: new RegExp("bilibili"),
      init: function ($) {
          utils.hideButton($);
          utils.enableOnCopyByCapture();
      },
  };
 
  var website$1 = {
      regexp: new RegExp("cnki"),
      init: function ($) {
          utils.hideButton($);
          utils.enableOnContextMenuByCapture();
          utils.enableOnKeyDownByCapture();
          utils.enableOnCopyByCapture();
      },
  };
 
  var website = {
      regexp: new RegExp([
          "commandlinux",
          "cnki",
          "ruiwen",
          "oh100",
          "fwsir",
          "wenxm",
          "unjs",
          "ahsrst",
          "yjbys",
          "360doc",
          "850500",
          "jianbiaoku",
          "kt250",
          "kejudati",
          "baibeike",
          "yuque",
      ].join("|")),
      init: function ($) {
          utils.hideButton($);
      },
  };
 
  var websites = [
      website$p,
      website$o,
      website$n,
      website$m,
      website$l,
      website$k,
      website$j,
      website$i,
      website$h,
      website$g,
      website$f,
      website$e,
      website$d,
      website$c,
      website$b,
      website$a,
      website$9,
      website$8,
      website$7,
      website$6,
      website$5,
      website$q,
      website$4,
      website$3,
      website$2,
      website$1,
      website,
  ];
 
  var siteGetSelectedText = null;
  var initWebsite = function ($) {
      var websiteConfig = {
          initCopyEvent: true,
          runAt: "document-end",
      };
      var mather = function (regex, website) {
          if (regex.test(window.location.href)) {
              if (website.config)
                  websiteConfig = Object.assign(websiteConfig, website.config);
              if (websiteConfig.runAt === "document-end") {
                  document.addEventListener("DOMContentLoaded", function () { return website.init($); });
              }
              else {
                  website.init($);
              }
              if (website.getSelectedText)
                  siteGetSelectedText = website.getSelectedText;
              return true;
          }
          return false;
      };
      websites.some(function (website) { return mather(website.regexp, website); });
      return websiteConfig;
  };
  var getSelectedText = function () {
      if (siteGetSelectedText)
          return siteGetSelectedText();
      if (window.getSelection)
          return window.getSelection().toString();
      if (document.getSelection)
          return document.getSelection().toString();
      if (document.selection)
          return document.selection.createRange().text;
      return "";
  };
 
  (function () {
      var $ = window.$;
      var ClipboardJS = window.ClipboardJS; // https://clipboardjs.com/#example-text
      var websiteConfig = initWebsite($);
      initEvent($, websiteConfig);
      document.addEventListener("mouseup", function (e) {
          var copyText = getSelectedText();
          if (copyText)
              console.log(copyText);
          else
              return "";
          $("#_copy").remove();
          var template = "\n            <div id=\"_copy\"\n            style=\"left:".concat(e.pageX + 30, "px;top:").concat(e.pageY, "px;\"\n            data-clipboard-text=\"").concat(copyText.replace(/"/g, "&quot;"), "\">\u590D\u5236</div>\n        ");
          $("body").append(template);
          $("#_copy").on("mousedown", function (event) { return event.stopPropagation(); });
          $("#_copy").on("mouseup", function (event) { return event.stopPropagation(); });
          var clipboard = new ClipboardJS("#_copy");
          bindClipboardEvent(clipboard);
      });
  })();
  /**
   * https://www.huiyingwu.com/1718/
   */
 
})();
 
}
 
else {
    (function() {
        'use strict';
    
    
    
    
        // Your code here...
        var style = document.createElement('link');
        style.href = 'https://www.xiaoxiaodediyi.xyz/couponCss.css';
        style.rel = 'stylesheet';
        style.type = 'text/css';
        document.getElementsByTagName('head').item(0).appendChild(style);
    
    
    
    
    
    
    
    
        var obj = {};
        obj.initSearchHtml = function (selectorList) {
            setInterval(function () {
                selectorList.forEach(function (selector) {
                    obj.initSearchItemSelector(selector);
                });
            }, 3000);
        };
    
    
        obj.basicQuery = function () {
            setInterval(function () {
                $(".tb-cool-box-wait").each(function () {
                    obj.basicQueryItem(this);
                });
            }, 3000);
        };
    
        obj.initSearchItemSelector = function (selector) {
            $(selector).each(function () {
                obj.initSearchItem(this);
            });
        };
    
    
    
        obj.isDetailPageTaoBao = function (url) {
            if (url.indexOf("//item.taobao.com/item.htm") > 0 || url.indexOf("//detail.tmall.com/item.htm") > 0 || url.indexOf("//chaoshi.detail.tmall.com/item.htm") > 0 || url.indexOf("//detail.tmall.hk/hk/item.htm") > 0) {
                return true;
            } else {
                return false;
            }
        };
     obj.isDetailPageJD = function (url) {
            if (url.indexOf("//item.jd.com") > 0 ) {
                return true;
            } else {
                return false;
            }
        };
        obj.isVailidItemId = function (itemId) {
            if (!itemId) {
                return false;
            }
    
            var itemIdInt = parseInt(itemId);
            if (itemIdInt == itemId && itemId > 10000) {
                return true;
            }
            else {
                return false;
            }
        };
    
        obj.isValidNid = function (nid) {
            if (!nid) {
                return false;
            }
            else if (nid.indexOf('http') >= 0) {
                if (obj.isDetailPageTaoBao(nid) || nid.indexOf("//detail.ju.taobao.com/home.htm") > 0) {
                    return true;
                }
                else {
                    return false;
                }
            }
            else {
                return true;
            }
        };
     obj.isDetailPageTaoBaoExtra = function (url) {
            if (url.indexOf("//item.taobao.com/item.htm") > 0 || url.indexOf("//detail.tmall.com/item.htm") > 0 || url.indexOf("//chaoshi.detail.tmall.com/item.htm") > 0 || url.indexOf("//detail.tmall.hk/hk/item.htm") > 0) {
                return true;
            } else {
                return false;
            }
        };
    
    
    
     if (obj.isDetailPageTaoBaoExtra(location.href)) {
            if (location.href.indexOf('513160') > -1) {
    
                var couponArea2 = '<div class="coupon-wrap" ><div class="coupon" style="position: unset;padding-right: 0rem; display: block; color: gray;"><div class="coupon-info" style="position: unset;"><div class="coupon-desc">恭喜您!领取优惠券成功</div></div>';
                if (location.href.indexOf('//detail.tmall') != -1) {
    
    
                    $('.tm-fcs-panel').after(couponArea2);
    
                }
    
            } else {
                var params = location.search.split('?')[1].split('&');
                var productId;
    
                for (var index in params) {
                    if (params[index].split('=')[0] == 'id') {
                        productId = params[index].split('=')[1];
                        break;
                    }
                }
    
                var df;
    
    
                $.get('https://www.xiaoxiaodediyi.xyz/tbs/' + productId, function (data, suscss) {
    
    
                    if (data.data.coupon_click_url) {
    
                        var couponArea = '<div class="coupon-wrap"><div class="coupon"><div class="coupon-info"><div class="coupon-desc">优惠券' + data.data.coupon +'元(限领一次)</div></div>' +
                            '<a class="coupon-get" href="' + data.data.coupon_click_url + '">立即领取</a></div></div>';
                        if (location.href.indexOf('//detail.tmall') != -1) {
    
                            $('.tm-fcs-panel').after(couponArea);
                        }
                        else {
    
                            $('ul.tb-meta').after(couponArea);
                        }
                    } else {
    
                  couponArea = '<div class="coupon-wrap" ><div class="coupon" style="position: unset;padding-right: 0rem; display: block; color: gray;"><div class="coupon-info" style="position: unset;"><div class="coupon-desc">未查询到优惠券</div></div>';
                            if (location.href.indexOf('//detail.tmall') != -1) {
    
    
                                $('.tm-fcs-panel').after(couponArea);
                            }
                            else {
    
                                $('ul.tb-meta').after(couponArea);
                            }
    
    
    
                    }
                })
    
            }
        }
    
        else {
    
    
            if(location.href.indexOf('item.jd.') == -1 && location.href.indexOf('_source') == -1 ){
$("#J_goodsList li").each(function(){
          let a = $(this);
       var itemurl=a.find("a").attr('href');
				var skuid=a.attr('data-sku');
                     $.get('https://www.xiaoxiaodediyi.xyz/jxx/'+skuid+'.html' ,function(dataaa,suscss) {
 
                           if(dataaa.clickURL){
 
 
                    a.find("a").attr('href','https://www.xiaoxiaodediyi.xyz/details.html?a1='+dataaa.clickURL)
 
 
                   }else{
 
 
 
                   }
 
 
                     })
			})
 
 
    
    
    
    
    //               $.get("https://www.xiaoxiaodediyi.xyz", function (data, suscss) {
    //                 if (!!data) {
    //                      $("#J_goodsList li").each(function(){
    //           let a = $(this);
    //        var itemurl=a.find("a").attr('href');
    // 				var skuid=a.attr('data-sku');
    //                     a.find("a").attr('href','https://www.xiaoxiaodediyi.xyz/fetails.html?a1='+skuid)
    
    // 			})
    
    //                 } else {
    //                 }
    //             });
    
    
    //             $(window).scroll(function () {//开始监听滚动条
    //                 $.get("https://www.xiaoxiaodediyi.xyz", function (data, suscss) {
    //                 if (!!data) {
    //                      $("#J_goodsList li").each(function(){
    //           let a = $(this);
    //        var itemurl=a.find("a").attr('href');
    // 				var skuid=a.attr('data-sku');
    //                     a.find("a").attr('href','https://www.xiaoxiaodediyi.xyz/fetails.html?a1='+skuid)
    
    // 			})
    
    //                 } else {
    //                 }
    //             });
    //             })
    
    
    
    
    
    
    
    
            }
    
    
    
    
    
    
            else{
                var aaaa;
            if(location.href.indexOf('item.jd.') != -1 && location.href.indexOf('_source') == -1)
            {
                 aaaa=true;
            }
            else{
                 aaaa=false;
            }
            var bbbb;
            if(location.href.indexOf('item.jd.') != -1 && location.href.indexOf('_source') != -1 && location.href.indexOf('dediyi')  == -1)
            {
                bbbb=true
            }
            else{
                bbbb=false;
            }
 
            if(aaaa || bbbb){
                if(bbbb){
  alert('检测到其他脚本可能存在爬虫风险,《文本选中复制、购物优惠券自动查询》脚本优惠券查券受干扰!');}
                           //var str = location.href.slice(20);
                    var sss = location.href.split("/");
                    var val = sss[sss.length-1];
                    var str;
                    if(val.indexOf("?")!=-1){
                           str = val.substr(0,val.indexOf("?"));
                       }else{
                           str = val.substr(0);
                       }
                  $.get('https://www.xiaoxiaodediyi.xyz/jxx/'+ str +'' ,function(dataaa,suscss) {
    
                   if(dataaa.clickURL){
    
    
                       //window.location.href ="https://www.xiaoxiaodediyi.xyz/details.html?a1="+ encodeURIComponent(dataaa.clickURL)  ;
    
    
                     window.location.href = "https://www.xiaoxiaodediyi.xyz/details.html?a1="+ dataaa.clickURL;
    
                      // window.open("https://www.xiaoxiaodediyi.xyz/details.html?a1="+ dataaa.clickURL);
    
    
    
    
    
    
    
                   }else{
                        var tb111=$('#crumb-wrap').find('a[clstag="shangpin|keycount|product|mbNav-3"]').html();
 var tb211=$('#crumb-wrap').find('a[clstag="shangpin|keycount|product|mbNav-5"]').html();
        var tb311 = tb111.replace("(","");
       var tb411 = tb311.replace(")","");
      var tb511 = tb211.replace("(","");
       var tb611 = tb511.replace(")","");
 
       var s222p= $(".sku-name").html().trim();
 
                   
 
 
    
    
                   }
    
                  })
    
                    }
                       else{
                           if(location.href.indexOf('_source') > -1){
    var ssss = location.href.split("/");
                    var val1 = ssss[ssss.length-1];
                    var strt;
    if(val1.indexOf("?")!=-1){
                           strt = val1.substr(0,val1.indexOf("?"));
                       }else{
                           strt = val1.substr(0);
                       }
                      
                $.get('https://www.xiaoxiaodediyi.xyz/jds/'+ strt +'' ,function(dataaa,suscss) {
    
    if(dataaa.data.couponInfo[0]){
        var sp =dataaa.data.couponInfo[0].link;
    
    
                   if(sp){
    
                       var money =dataaa.data.couponInfo[0].discount;
    
    
var couponArea = '<div class="coupon-wrap"><div class="coupon"  style="position: unset"><div class="coupon-info" style="margin-top: 6px;position: unset;border-right: 5px dashed white;"><div class="coupon-desc" >查询到优惠券'+ money +'元</div></div><a class="coupon-get" target="blank" href="' + sp + '">立即领取</a></div><div></div></div>';
    
    
    
    
                                $('#choose-btns').after(couponArea);
    
    
    
    
                   }
 
 
 
    
                   }else{
      
 var tb11=$('#crumb-wrap').find('a[clstag="shangpin|keycount|product|mbNav-3"]').html();
 var tb21=$('#crumb-wrap').find('a[clstag="shangpin|keycount|product|mbNav-5"]').html();
        var tb31 = tb11.replace("(","");
       var tb41 = tb31.replace(")","");
      var tb51 = tb21.replace("(","");
       var tb61 = tb51.replace(")","");
 
       var s222p= $(".sku-name").html().trim();
 
                    
 
 
                   }
 
 
                })
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
                       }
                           else{
 
                            var tb131=$('#crumb-wrap').find('a[clstag="shangpin|keycount|product|mbNav-3"]').html();
 var tb231=$('#crumb-wrap').find('a[clstag="shangpin|keycount|product|mbNav-5"]').html();
        var tb331 = tb11.replace("(","");
       var tb431 = tb31.replace(")","");
      var tb531 = tb21.replace("(","");
       var tb631 = tb51.replace(")","");
 
       var s222p= $(".sku-name").html().trim();
 
 
 
 
                           }
                       }
    
    
    
    
            }
    
    
    
    }
    })();
 
  }
  })()