解除网站不允许复制的限制(优化版)🔥🔥🔥

解除部分网站不允许复制的限制,文本选中后点击复制按钮即可复制,主要用于:百度文库|道客巴巴|腾讯文档|豆丁网|无忧考网|学习啦|蓬勃范文|思否社区|力扣|知乎|语雀|QQ文档|360doc|17k|CSDN等,云服务器导航,在原脚本的基础上,优化了部分功能,如有补充请留言反馈~

  1. // ==UserScript==
  2. // @name 解除网站不允许复制的限制(优化版)🔥🔥🔥
  3. // @name:zh 解除网站不允许复制的限制(优化版)🔥🔥🔥
  4. // @name:zh-TW 解除網站不允許複製的限制(優化版)🔥🔥🔥
  5. // @description 解除部分网站不允许复制的限制,文本选中后点击复制按钮即可复制,主要用于:百度文库|道客巴巴|腾讯文档|豆丁网|无忧考网|学习啦|蓬勃范文|思否社区|力扣|知乎|语雀|QQ文档|360doc|17k|CSDN等,云服务器导航,在原脚本的基础上,优化了部分功能,如有补充请留言反馈~
  6. // @description:zh 解除部分网站不允许复制的限制,文本选中后点击复制按钮即可复制,主要用于:百度文库|道客巴巴|腾讯文档|豆丁网|无忧考网|学习啦|蓬勃范文|思否社区|力扣|知乎|语雀|QQ文档|360doc|17k|CSDN等,云服务器导航,在原脚本的基础上,优化了部分功能,如有补充请留言反馈~
  7. // @description:zh-TW 解除部分網站不允許複製的限制,文本選中後點擊複製按鈕即可複製,主要用於:百度文庫|道客巴巴|騰訊文檔|豆丁網|無憂考網|學習啦|蓬勃範文|思否社區|力扣|知乎|語雀|QQ文檔|360doc|17k|CSDN等,雲伺服器導航,在原指令碼或直譯式程式的基礎上,優化了部分功能,如有補充請留言反饋~
  8. // @namespace picassoTX_lifting_restrictions
  9. // @version 2.0.4
  10. // @author WindrunnerMax,picassoTX
  11. // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAWtJREFUaEPtmeERwiAMhYuuo87QzqAr6LmF7RZeXcHO0M6grqPxaq2HnC0BA8IZ/woh33sJekEkkX9E5Pkn/wMwW21TAddd55hI3TgHzbk6ZCax0Q7MlxswCWy/1gwCBbBYbXKA5Km+fWr4nXiIoACESApZKBCT7HLcN2PgQQG0CT86DG51n7QOIjiAVvHuwsBBvAHIjSqT++oBVe35cl33N15bXqdjmavlFDRAm6wOIngAHURQANhr9lyVr7wZAKsa5Tp2gFJNm1jsgKyarIaNmkN7xn48SR1ggAELvDlAWTbYWKQlhD2Uch0D8C2EqCdvTRz9NYoQk3wJNzG5pIYBSR2IvgcYgP8LSQr8erCF7WXSJsYeSrnOGECdVVImYxPLGKCbjvl64BhHUmekqMFWH9LXkPczAjQgpoX6XmAEYGO36z0M4FphXfxBB3QbXX8/9KChnssArpywcsBVMi7jol4pXSbwbezoAe60/xRPTdKM8AAAAABJRU5ErkJggg==
  12. // @match *://wenku.baidu.com/view/*
  13. // @match *://wenku.baidu.com/share/*
  14. // @match *://wenku.baidu.com/link*
  15. // @match *://wenku.baidu.com/aggs/*
  16. // @match *://wenku.baidu.com/ndPureView/*
  17. // @match *://*.doc88.com/*
  18. // @match *://wk.baidu.com/view/*
  19. // @match *://*.zhihu.com/*
  20. // @match *://docs.qq.com/doc/*
  21. // @match *://docs.qq.com/sheet/*
  22. // @match *://boke112.com/*/*
  23. // @match *://*.diyifanwen.com/*
  24. // @match *://www.uemeds.cn/*
  25. // @match *://www.oh100.com/*
  26. // @match *://www.aiyuke.com/news/*
  27. // @match *://www.fwsir.com/*
  28. // @match *://www.wenxm.cn/*
  29. // @match *://www.unjs.com/*
  30. // @match *://*.yjbys.com/*
  31. // @match *://*.qidian.com/*
  32. // @match *://*.zongheng.com/*
  33. // @match *://*.17k.com/*
  34. // @match *://*.ciweimao.com/*
  35. // @match *://book.qq.com/*
  36. // @match *://*.360doc.com/content/*
  37. // @match *://*.850500.com/news/*
  38. // @match *://utaten.com/lyric/*
  39. // @match *://*.jianbiaoku.com/*
  40. // @match *://www.kejudati.com/*
  41. // @match *://*.blog.csdn.net/*
  42. // @match *://*.bilibili.com/read/*
  43. // @match *://*.cnki.net/KXReader/*
  44. // @match *://*.cnrencai.com/*
  45. // @match *://*.jianshu.com/p/*
  46. // @match *://*.linovelib.com/novel/*
  47. // @match *://*.juejin.cn/post/*
  48. // @match *://*.zgbk.com/ecph/*
  49. // @match *://yuedu.baidu.com/*
  50. // @match *://www.shubaoc.com/*
  51. // @match *://blog.51cto.com/*
  52. // @match *://*.docin.com/*
  53. // @match *://*.ddwk8.cn/*
  54. // @match *://fanqienovel.com/*
  55. // @match *://*.examcoo.com/*
  56. // @match *://*.rrdynb.com/*
  57. // @match *://*.fuwu7.com/*
  58. // @match *://*.aipiaxi.com/*
  59. // @match *://wenku.csdn.net/*
  60. // @match *://www.kdocs.cn/*
  61. // @match *://*.mcmod.cn/*
  62. // @match *://*.yuque.com/*
  63. // @match *://*.51cto.com/*
  64. // @match *://vcsmemo.com/article/*
  65. // @match *://www.jinrilvsi.com/*
  66. // @match *://www.9136.com/*
  67. // @match *://www.jdxzz.com/*
  68. // @match *://www.gaosan.com/*/*.html
  69. // @match *://ai-bot.cn/sites/*.html
  70. // @match *://www.lyrical-nonsense.com/lyrics/*
  71. // @match *://tongxiehui.net/by/*
  72. // @match *://www.xuexila.com/*
  73. // @match *://www.ruiwen.com/article/*
  74. // @match *://*.cooco.net.cn/testdetail/**
  75. // @match *://*.cloud.tencent.com/*
  76. // @match *://cloud.tencent.com/*
  77. // @match *://*.huaweicloud.com/*
  78. // @match *://*.aliyun.com/*
  79. // @match *://www.51test.net/show/*.html
  80. // @match *://16map.com/sites/*.html
  81. // @match *://*.lqsbcl.net/*/**
  82. // @exclude *://cloud.tencent.com/login*
  83. // @exclude *://console.cloud.tencent.com/*
  84. // @exclude *://market.cloud.tencent.com/*
  85. // @exclude *://www.aliyun.com/smarter-engine/*
  86. // @exclude *://account.aliyun.com/*
  87. // @exclude *://developer.aliyun.com/*
  88. // @exclude *://promotion.aliyun.com/*
  89. // @exclude *://free.aliyun.com/*
  90. // @exclude *://summit.aliyun.com/*
  91. // @exclude *://startup.aliyun.com/*
  92. // @exclude *://university.aliyun.com/*
  93. // @exclude *://careers.aliyun.com/*
  94. // @exclude *://market.aliyun.com/*
  95. // @exclude *://yunqi.aliyun.com/*
  96. // @exclude *://help.aliyun.com/*
  97. // @exclude *://g.alicdn.com/*
  98. // @exclude *://passport.aliyun.com/*
  99. // @exclude *://*.console.aliyun.com/*
  100. // @exclude *://auth.huaweicloud.com/*
  101. // @exclude *://support.huaweicloud.com/*
  102. // @exclude *://console.huaweicloud.com/*
  103. // @exclude *://stat.doc88.com/*
  104. // @exclude *://www.lqsbcl.net/*
  105. // @connect server.staticj.top
  106. // @connect res3.doc88.com
  107. // @supportURL https://github.com/Picasso-TX/TKScript/issues
  108. // @license MIT
  109. // @run-at document-start
  110. // @antifeature referral-link 【此提示为满足GreasyFork社区规范而添加,实际使用无任何强制跳转,代码可查,请知悉】
  111. // @grant unsafeWindow
  112. // @grant GM_xmlhttpRequest
  113. // @grant GM_openInTab
  114. // @grant GM.openInTab
  115. // @grant GM_addStyle
  116. // @grant GM_getValue
  117. // @grant GM_setValue
  118. // @grant GM_xmlhttpRequest
  119. // @grant GM_registerMenuCommand
  120. // ==/UserScript==
  121. (function () {
  122. 'use strict';
  123.  
  124. var css_248z$2 = ".__copied-button{align-items:center;background:#000;border-radius:3px;color:#fff;cursor:pointer;display:flex;font-size:12px;justify-content:center;opacity:0;padding:4px 10px;position:absolute;transition:opacity .3s;z-index:-1000}";
  125.  
  126. var css_248z$1 = "#select-tooltip,#sfModal,.modal-backdrop,div[id^=reader-helper]{display:none!important}.modal-open{overflow:auto!important}._sf_adjust_body{padding-right:0!important}";
  127.  
  128. var css_248z = "@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@-webkit-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@-moz-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@-o-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@-ms-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}@-webkit-keyframes fadeOut{0%{opacity:1}to{opacity:0}}@-moz-keyframes fadeOut{0%{opacity:1}to{opacity:0}}@-o-keyframes fadeOut{0%{opacity:1}to{opacity:0}}@-ms-keyframes fadeOut{0%{opacity:1}to{opacity:0}}.web-toast-kkli9{background:rgba(0,0,0,.7);border-radius:3px;color:#fff;font-size:14px;left:50%;line-height:1;padding:10px;position:fixed;transform:translateX(-50%);-webkit-transform:translateX(-50%);-moz-transform:translateX(-50%);-o-transform:translateX(-50%);-ms-transform:translateX(-50%);white-space:nowrap;z-index:1e+27}.fadeOut{animation:fadeOut .5s}.fadeIn{animation:fadeIn .5s}";
  129.  
  130. /*!
  131. * 版权说明:原脚本https://github.com/WindrunnerMax/TKScript/ 采用MIT开源协议
  132. * 本脚本开源地址:https://github.com/Picasso-TX/TKScript 继承原脚本,以MIT协议开源
  133. *
  134. * MIT协议是一种开放源代码软件授权协议,全称为Massachusetts Institute of Technology License。
  135. * 该协议允许自由地使用、复制、修改、合并、发布、分发、再授权和销售软件及其副本的任何部分。
  136. * MIT协议要求在软件的所有副本中包含版权声明和许可声明
  137. *
  138. * 特此声明!
  139. */
  140. const DOM_STAGE = {
  141. START: "document-start",
  142. END: "document-end"
  143. };
  144. const DOM_READY = "DOMContentLoaded";
  145. const PAGE_LOADED = "load";
  146. const MOUSE_UP = "mouseup";
  147. const COPY = "copy";
  148. const SELECT_START = "selectstart";
  149. const CONTEXT_MENU = "contextmenu";
  150. const KEY_DOWN = "keydown";
  151.  
  152. const opt = Object.prototype.toString;
  153. function isString(value) {
  154. return opt.call(value) === "[object String]";
  155. }
  156.  
  157. const dom$1 = {
  158. query: function(selector) {
  159. return document.querySelector(selector);
  160. },
  161. attr: function(selector, attr, value) {
  162. const dom2 = document.querySelector(selector);
  163. dom2 && dom2.setAttribute(attr, value);
  164. },
  165. append: function(selector, content) {
  166. const container = document.createElement("div");
  167. if (isString(content)) {
  168. container.innerHTML = content;
  169. } else {
  170. container.appendChild(content);
  171. }
  172. const targetDOM = document.querySelector(selector);
  173. targetDOM && targetDOM.append(container);
  174. return container;
  175. },
  176. remove: function(selector) {
  177. const targetDOM = document.querySelector(selector);
  178. targetDOM && targetDOM.remove();
  179. }
  180. };
  181.  
  182. const initBaseEvent = (websiteConfig) => {
  183. window.addEventListener(DOM_READY, () => {
  184. if (websiteConfig.initCopyEvent) {
  185. document.oncopy = (e) => e.stopPropagation();
  186. document.body.oncopy = (e) => e.stopPropagation();
  187. document.addEventListener(COPY, (e) => e.stopPropagation());
  188. document.body.addEventListener(COPY, (e) => e.stopPropagation());
  189. }
  190. });
  191. };
  192. const initBaseStyle = () => {
  193. window.addEventListener(DOM_READY, () => {
  194. dom$1.append("head", `<style>${css_248z$2}</style>`);
  195. dom$1.append("head", `<style>${css_248z$1}</style>`);
  196. dom$1.append("head", `<style>${css_248z}</style>`);
  197. });
  198. };
  199.  
  200. /*!
  201. * 外部引用`static.doc88.com`声明
  202. * 此部分是在处理`doc88.com`才会加载的资源文件,此资源文件由该网站加载时提供
  203. */
  204. let path = "";
  205. const website$o = {
  206. regexp: /.*doc88\.com\/.+/,
  207. init: () => {
  208. dom$1.append(
  209. "body",
  210. `<style id="copy-element-hide">#left-menu{display: none !important;}</style>`
  211. );
  212. GM_xmlhttpRequest({
  213. method: "GET",
  214. url: "https://res3.doc88.com/resources/js/modules/main-v2.min.js?v=2.56",
  215. onload: function(response) {
  216. const result = /\("#cp_textarea"\).val\(([\S]*?)\);/.exec(response.responseText);
  217. if (result)
  218. path = result[1];
  219. }
  220. });
  221. window.addEventListener("load", () => {
  222. const cpFn = unsafeWindow.copyText.toString();
  223. const fnResult = /<textarea[\s\S]*?>'\+([\S]*?)\+"<\/textarea>/.exec(cpFn);
  224. if (fnResult)
  225. path = fnResult[1];
  226. });
  227. },
  228. getSelectedText: () => {
  229. let select = unsafeWindow;
  230. path.split(".").forEach((v) => {
  231. select = select[v];
  232. });
  233. if (!select) {
  234. unsafeWindow.Config.vip = 1;
  235. unsafeWindow.Config.logined = 1;
  236. dom$1.remove("#copy-element-hide");
  237. }
  238. return select;
  239. }
  240. };
  241.  
  242. const TEXT_PLAIN = "text/plain";
  243. const TEXT_HTML = "text/html";
  244. const execCopyCommand = (data) => {
  245. const textarea = document.createElement("textarea");
  246. const handler = (event) => {
  247. event.preventDefault();
  248. event.stopImmediatePropagation();
  249. for (const [key, value] of Object.entries(data)) {
  250. event.clipboardData && event.clipboardData.setData(key, value);
  251. }
  252. };
  253. textarea.addEventListener(COPY, handler, true);
  254. textarea.style.position = "fixed";
  255. textarea.style.left = "-999999999px";
  256. textarea.style.top = "-999999999px";
  257. textarea.value = data[TEXT_PLAIN] || " ";
  258. document.body.appendChild(textarea);
  259. textarea.select();
  260. document.execCommand("copy");
  261. textarea.removeEventListener(COPY, handler);
  262. document.body.removeChild(textarea);
  263. };
  264. const isEmptyContent = (data) => {
  265. if (!data)
  266. return true;
  267. return isString(data) ? !data : !data[TEXT_PLAIN];
  268. };
  269. const copy = (data) => {
  270. const params = isString(data) ? { [TEXT_PLAIN]: data } : data;
  271. const plainText = params[TEXT_PLAIN];
  272. if (!plainText)
  273. return false;
  274. if (navigator.clipboard && window.ClipboardItem) {
  275. const dataItems = {};
  276. for (const [key, value] of Object.entries(params)) {
  277. const blob = new Blob([value], { type: key });
  278. dataItems[key] = blob;
  279. }
  280. navigator.clipboard.write([new ClipboardItem(dataItems)]).catch(() => {
  281. execCopyCommand(params);
  282. });
  283. } else {
  284. execCopyCommand(params);
  285. }
  286. return true;
  287. };
  288.  
  289. let dom = null;
  290. let isReadyToHidden = false;
  291. const instance = {
  292. id: "__copy",
  293. className: "__copied-button",
  294. init: function(name) {
  295. const container = document.createElement("div");
  296. container.id = this.id;
  297. container.className = this.className;
  298. container.innerText = name || "复制";
  299. container.addEventListener("mouseup", (e) => e.stopPropagation(), true);
  300. container.addEventListener("mousedown", (e) => e.stopPropagation(), true);
  301. dom = container;
  302. document.body.appendChild(dom);
  303. },
  304. getInstance: function() {
  305. if (dom === null) {
  306. this.init();
  307. }
  308. return dom;
  309. },
  310. show: function(event) {
  311. if (isReadyToHidden)
  312. return void 0;
  313. const dom2 = this.getInstance();
  314. dom2.style.left = `${event.pageX + 30}px`;
  315. dom2.style.top = `${event.pageY}px`;
  316. dom2.style.opacity = "1";
  317. dom2.style.zIndex = "1000";
  318. },
  319. hide: function(keep = 350) {
  320. const dom2 = this.getInstance();
  321. dom2.style.opacity = "0";
  322. if (keep) {
  323. isReadyToHidden = true;
  324. setTimeout(() => {
  325. dom2.style.zIndex = "-10000";
  326. isReadyToHidden = false;
  327. }, keep);
  328. }
  329. },
  330. onCopy: function(content, event) {
  331. const dom2 = this.getInstance();
  332. this.show(event);
  333. dom2.onclick = () => {
  334. copy(content);
  335. this.hide();
  336. };
  337. },
  338. enable: function() {
  339. const dom2 = this.getInstance();
  340. dom2.style.display = "flex";
  341. },
  342. disable: function() {
  343. const dom2 = this.getInstance();
  344. dom2.style.display = "none";
  345. },
  346. destroy: function() {
  347. const el = this.getInstance();
  348. el.remove();
  349. dom = null;
  350. }
  351. };
  352.  
  353. const stopNativePropagation = (event) => {
  354. event.stopPropagation();
  355. };
  356. var utils = {
  357. hideButton: () => {
  358. instance.disable();
  359. },
  360. showButton: () => {
  361. instance.enable();
  362. },
  363. removeAttributes: (selector, attr = []) => {
  364. const dom = isString(selector) ? document.querySelector(selector) : selector;
  365. dom && attr.forEach((item) => dom.removeAttribute(item));
  366. },
  367. enableUserSelectByCSS: (css) => {
  368. const defaultCss = `
  369. *{-webkit-touch-callout: auto !important;-webkit-user-select: auto !important;-moz-user-select: auto !important;-khtml-user-select: auto !important;-ms-user-select: auto !important;}
  370. `;
  371. const style = document.createElement("style");
  372. style.innerHTML = !!css ? css : defaultCss;
  373. const head = document.getElementsByTagName("head")[0];
  374. if (head) {
  375. head.appendChild(style);
  376. } else {
  377. window.addEventListener(
  378. PAGE_LOADED,
  379. () => document.getElementsByTagName("head")[0].appendChild(style)
  380. );
  381. }
  382. },
  383. enableOnSelectStart: (selector) => {
  384. const dom = document.querySelector(selector);
  385. dom && dom.addEventListener(SELECT_START, stopNativePropagation);
  386. },
  387. enableOnContextMenu: (selector) => {
  388. const dom = document.querySelector(selector);
  389. dom && dom.addEventListener(CONTEXT_MENU, stopNativePropagation);
  390. },
  391. enableOnCopy: (selector) => {
  392. const dom = document.querySelector(selector);
  393. dom && dom.addEventListener(COPY, stopNativePropagation);
  394. },
  395. enableOnKeyDown: (selector) => {
  396. const dom = document.querySelector(selector);
  397. dom && dom.addEventListener(KEY_DOWN, (e) => {
  398. if (e.key === "c" && e.ctrlKey)
  399. return e.stopPropagation();
  400. });
  401. },
  402. enableOnSelectStartByCapture: () => {
  403. window.addEventListener(SELECT_START, stopNativePropagation, true);
  404. document.addEventListener(SELECT_START, stopNativePropagation, true);
  405. },
  406. enableOnContextMenuByCapture: () => {
  407. window.addEventListener(CONTEXT_MENU, stopNativePropagation, true);
  408. document.addEventListener(CONTEXT_MENU, stopNativePropagation, true);
  409. },
  410. enableOnCopyByCapture: () => {
  411. window.addEventListener(COPY, stopNativePropagation, true);
  412. document.addEventListener(COPY, stopNativePropagation, true);
  413. },
  414. enableOnKeyDownByCapture: () => {
  415. document.addEventListener(
  416. KEY_DOWN,
  417. (e) => e.ctrlKey && e.key.toLocaleUpperCase() === "C" && e.stopPropagation(),
  418. true
  419. );
  420. }
  421. };
  422.  
  423. const website$n = {
  424. regexp: /.*wk\.baidu\.com\/view\/.+/,
  425. init: function() {
  426. utils.hideButton();
  427. utils.enableOnSelectStartByCapture();
  428. window.onload = () => {
  429. dom$1.attr(".sf-edu-wenku-vw-container", "style", "");
  430. };
  431. }
  432. };
  433.  
  434. const website$m = {
  435. regexp: /.*zhihu\.com\/.*/,
  436. init: function() {
  437. utils.hideButton();
  438. utils.enableUserSelectByCSS();
  439. utils.enableOnCopyByCapture();
  440. if (location.hostname === "zhuanlan.zhihu.com") {
  441. const removeFocalPointModal = (mutationsList) => {
  442. for (const mutation of mutationsList) {
  443. const addedNodes = mutation.addedNodes;
  444. for (let i = 0; i < addedNodes.length; i++) {
  445. const target = addedNodes[i];
  446. if (target.nodeType != 1)
  447. return void 0;
  448. if (target instanceof HTMLDivElement && target.querySelector("[data-focus-scope-start]")) {
  449. const element = target.querySelector("[data-focus-scope-start]");
  450. element && element.parentElement && element.parentElement.textContent && element.parentElement.textContent.indexOf("立即登录/注册") > -1 && element.parentElement.parentElement && element.parentElement.parentElement.removeChild(element.parentElement);
  451. }
  452. }
  453. }
  454. };
  455. const observer = new MutationObserver(removeFocalPointModal);
  456. observer.observe(document, { childList: true, subtree: true });
  457. }
  458. }
  459. };
  460.  
  461. const website$l = {
  462. regexp: /.*docs\.qq\.com\/.+/,
  463. config: {
  464. initCopyEvent: false,
  465. captureInstance: true,
  466. delay: 100
  467. },
  468. init: function() {
  469. window.onload = () => {
  470. utils.hideButton();
  471. };
  472. },
  473. getSelectedText: function() {
  474. var _a;
  475. if (unsafeWindow.pad && unsafeWindow.pad.editor && !unsafeWindow.pad.editor.isCopyable()) {
  476. utils.showButton();
  477. const editor = unsafeWindow.pad.editor;
  478. if (editor.getCopyContent) {
  479. const content = editor.getCopyContent() || {};
  480. const plainText = content.plain || "";
  481. const htmlText = content.html || "";
  482. return {
  483. [TEXT_PLAIN]: plainText,
  484. [TEXT_HTML]: htmlText
  485. };
  486. } else {
  487. editor._docEnv.copyable = true;
  488. editor.clipboardManager.copy();
  489. const plainText = editor.clipboardManager.customClipboard.plain || "";
  490. const htmlText = editor.clipboardManager.customClipboard.html || "";
  491. editor._docEnv.copyable = false;
  492. return {
  493. [TEXT_PLAIN]: plainText,
  494. [TEXT_HTML]: htmlText
  495. };
  496. }
  497. } else if (unsafeWindow.SpreadsheetApp && unsafeWindow.SpreadsheetApp.permissions && unsafeWindow.SpreadsheetApp.permissions.sheetStatus && unsafeWindow.SpreadsheetApp.permissions.sheetStatus.canCopy === false && unsafeWindow.SpreadsheetApp.permissions.sheetStatus.canEdit && unsafeWindow.SpreadsheetApp.permissions.sheetStatus.canEdit() === false) {
  498. utils.showButton();
  499. const SpreadsheetApp = unsafeWindow.SpreadsheetApp;
  500. const [selection] = SpreadsheetApp.view.getSelectionRanges();
  501. if (selection) {
  502. const text = [];
  503. const { startColIndex, startRowIndex, endColIndex, endRowIndex } = selection;
  504. for (let i = startRowIndex; i <= endRowIndex; i++) {
  505. for (let k = startColIndex; k <= endColIndex; k++) {
  506. const cell = SpreadsheetApp.workbook.activeSheet.getCellDataAtPosition(i, k);
  507. if (!cell)
  508. continue;
  509. text.push(" ", ((_a = cell.formattedValue) == null ? void 0 : _a.value) || cell.value || "");
  510. }
  511. i !== endRowIndex && text.push("\n");
  512. }
  513. const str = text.join("");
  514. return /^\s*$/.test(str) ? "" : str;
  515. }
  516. return "";
  517. }
  518. return "";
  519. }
  520. };
  521.  
  522. const website$k = {
  523. regexp: new RegExp("boke112\\.com"),
  524. init: function() {
  525. utils.enableOnCopyByCapture();
  526. const template = `
  527. <style>
  528. :not(input):not(textarea)::selection {
  529. background-color: #2440B3 !important;
  530. color: #fff !important;
  531. }
  532.  
  533. :not(input):not(textarea)::-moz-selection {
  534. background-color: #2440B3 !important;
  535. color: #fff !important;
  536. }
  537. </style>
  538. `;
  539. dom$1.append("head", template);
  540. }
  541. };
  542.  
  543. const website$j = {
  544. regexp: /diyifanwen/,
  545. init: function() {
  546. utils.hideButton();
  547. utils.enableOnCopyByCapture();
  548. utils.enableOnKeyDownByCapture();
  549. }
  550. };
  551.  
  552. const website$i = {
  553. regexp: /mbalib/,
  554. init: function() {
  555. window.onload = () => {
  556. utils.removeAttributes("fullScreenContainer", ["oncopy", "oncontextmenu", "onselectstart"]);
  557. };
  558. }
  559. };
  560.  
  561. const website$h = {
  562. regexp: new RegExp(".+www.uemeds.cn/.+"),
  563. init: function() {
  564. utils.hideButton();
  565. utils.enableUserSelectByCSS();
  566. }
  567. };
  568.  
  569. const website$g = {
  570. regexp: new RegExp(".+aiyuke.com/news/.+"),
  571. init: function() {
  572. utils.hideButton();
  573. utils.enableUserSelectByCSS();
  574. }
  575. };
  576.  
  577. const website$f = {
  578. regexp: new RegExp("qidian"),
  579. init: function() {
  580. utils.hideButton();
  581. utils.enableUserSelectByCSS();
  582. utils.enableOnCopy(".main-read-container");
  583. utils.enableOnContextMenu(".main-read-container");
  584. }
  585. };
  586.  
  587. const website$e = {
  588. regexp: new RegExp("zongheng"),
  589. init: function() {
  590. utils.removeAttributes(".reader_box", ["style", "unselectable", "onselectstart"]);
  591. utils.removeAttributes(".reader_main", ["style", "unselectable", "onselectstart"]);
  592. utils.hideButton();
  593. utils.enableOnKeyDown("body");
  594. utils.enableUserSelectByCSS();
  595. utils.enableOnCopy(".content");
  596. utils.enableOnContextMenu("body");
  597. utils.enableOnSelectStart(".content");
  598. }
  599. };
  600.  
  601. const website$d = {
  602. regexp: new RegExp("17k"),
  603. init: () => {
  604. utils.hideButton();
  605. utils.enableOnCopy(".readAreaBox .p");
  606. }
  607. };
  608.  
  609. const website$c = {
  610. regexp: new RegExp("ciweimao"),
  611. init: function() {
  612. utils.hideButton();
  613. utils.enableUserSelectByCSS();
  614. utils.enableOnCopy("#J_BookCnt");
  615. utils.enableOnContextMenu("body");
  616. utils.enableOnSelectStart("#J_BookCnt");
  617. }
  618. };
  619.  
  620. const website$b = {
  621. regexp: new RegExp("book\\.qq"),
  622. init: function() {
  623. utils.hideButton();
  624. utils.enableOnCopy("body");
  625. utils.enableUserSelectByCSS();
  626. utils.enableOnContextMenu("body");
  627. utils.enableOnSelectStart("body");
  628. }
  629. };
  630.  
  631. const website$a = {
  632. regexp: new RegExp("utaten"),
  633. init: function() {
  634. utils.hideButton();
  635. utils.enableUserSelectByCSS();
  636. utils.enableOnSelectStartByCapture();
  637. }
  638. };
  639.  
  640. const website$9 = {
  641. config: {
  642. runAt: "document-start"
  643. },
  644. regexp: new RegExp("wenku.baidu.com/(view|link|aggs).*"),
  645. init: function() {
  646. dom$1.append("head", `<style>@media print { body{ display:block; } }</style>`);
  647. let canvasDataGroup = [];
  648. const originObject = {
  649. context2DPrototype: unsafeWindow.document.createElement("canvas").getContext("2d").__proto__
  650. };
  651. document.createElement = new Proxy(document.createElement, {
  652. apply: function(target, thisArg, argumentsList) {
  653. const element = Reflect.apply(target, thisArg, argumentsList);
  654. if (argumentsList[0] === "canvas") {
  655. const tmpData = {
  656. canvas: element,
  657. data: []
  658. };
  659. element.getContext("2d").fillText = function(...args) {
  660. tmpData.data.push(args);
  661. originObject.context2DPrototype.fillText.apply(this, args);
  662. };
  663. canvasDataGroup.push(tmpData);
  664. }
  665. return element;
  666. }
  667. });
  668. let pageData = {};
  669. Object.defineProperty(unsafeWindow, "pageData", {
  670. set: (v) => pageData = v,
  671. get: function() {
  672. if (!pageData.vipInfo)
  673. return pageData.vipInfo = {};
  674. pageData.vipInfo.global_svip_status = 1;
  675. pageData.vipInfo.global_vip_status = 1;
  676. pageData.vipInfo.isVip = 1;
  677. pageData.vipInfo.isWenkuVip = 1;
  678. return pageData;
  679. }
  680. });
  681. const templateCSS = [
  682. "<style id='copy-template-css'>",
  683. "body{overflow: hidden !important}",
  684. "#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);}",
  685. "#copy-template-html > .template-container{height: 80%; width: 80%; background: #fff; }",
  686. ".template-container > .title-container{display: flex; align-items: center; justify-content: space-between;padding: 10px;border-bottom: 1px solid #eee;}",
  687. "#copy-template-text{height: 100%; width: 100%;position: relative; overflow: auto;background: #fff;}",
  688. "#copy-template-html #template-close{cursor: pointer;}",
  689. "</style>"
  690. ].join("");
  691. const render = () => {
  692. canvasDataGroup = canvasDataGroup.filter((item) => item.canvas.id);
  693. var templateText = canvasDataGroup.map((canvasData, index) => {
  694. const computedTop = index * Number(canvasData.canvas.clientHeight);
  695. const textItem = canvasData.data.map(
  696. (item) => `<div style="position: absolute; left: ${item[1]}px; top: ${item[2] + computedTop}px">${item[0]}</div>`
  697. );
  698. return textItem.join("");
  699. });
  700. const editorView = document.querySelector("#editor-view");
  701. if (editorView) {
  702. templateText = [editorView.innerHTML];
  703. }
  704. const templateHTML = [
  705. "<div id='copy-template-html'>",
  706. "<div class='template-container'>",
  707. "<div class='title-container'>",
  708. "<div>请自行复制</div>",
  709. "<div id='template-close'>关闭</div>",
  710. "</div>",
  711. "<div id='copy-template-text'>",
  712. templateText.join(""),
  713. "</div>",
  714. "</div>",
  715. "</div>"
  716. ].join("");
  717. dom$1.append("body", templateHTML);
  718. dom$1.append("body", templateCSS);
  719. const closeButton = document.querySelector("#copy-template-html #template-close");
  720. const close = () => {
  721. dom$1.remove("#copy-template-html");
  722. dom$1.remove("#copy-template-css");
  723. closeButton && closeButton.removeEventListener("click", close);
  724. };
  725. closeButton && closeButton.addEventListener("click", close);
  726. };
  727. document.addEventListener("DOMContentLoaded", () => {
  728. dom$1.append(
  729. "head",
  730. `<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>`
  731. );
  732. dom$1.append("body", "<div id='copy-btn-wk'>复制</div>");
  733. const btn = dom$1.query("#copy-btn-wk");
  734. btn && (btn.onclick = render);
  735. });
  736. },
  737. getSelectedText: () => {
  738. if (window.getSelection && (window.getSelection() || "").toString()) {
  739. return (window.getSelection() || "").toString();
  740. }
  741. const result = /查看全部包含“([\s\S]*?)”的文档/.exec(document.body.innerHTML);
  742. if (result)
  743. return result[1];
  744. return "";
  745. }
  746. };
  747.  
  748. const STORAGE_KEYS = {
  749. "serverKey": "open_or_close_server_key"
  750. };
  751.  
  752. const toast = {
  753. show: (params) => {
  754. var time = params.time;
  755. var background = params.background;
  756. var color = params.color;
  757. var position = params.position;
  758. var defaultMarginValue = 50;
  759. if (time == void 0 || time == "") {
  760. time = 1500;
  761. }
  762. var el = document.createElement("div");
  763. el.setAttribute("class", "web-toast-kkli9");
  764. el.innerHTML = params.message;
  765. if (background != void 0 && background != "") {
  766. el.style.backgroundColor = background;
  767. }
  768. if (color != void 0 && color != "") {
  769. el.style.color = color;
  770. }
  771. if (position == void 0 || position == "") {
  772. position = "center-bottom";
  773. }
  774. if (position === "center-bottom") {
  775. el.style.bottom = defaultMarginValue + "px";
  776. } else {
  777. el.style.top = defaultMarginValue + "px";
  778. }
  779. el.style.zIndex = 999999;
  780. document.body.appendChild(el);
  781. el.classList.add("fadeIn");
  782. setTimeout(function() {
  783. el.classList.remove("fadeIn");
  784. el.classList.add("fadeOut");
  785. el.addEventListener("animationend", function() {
  786. document.body.removeChild(el);
  787. });
  788. el.addEventListener("webkitAnimationEnd", function() {
  789. document.body.removeChild(el);
  790. });
  791. }, time);
  792. }
  793. };
  794.  
  795. const menuCommand = {
  796. serverMenu: function() {
  797. var isOpenServer = GM_getValue(STORAGE_KEYS.serverKey, true);
  798. GM_registerMenuCommand("服务器导航设置", () => {
  799. var person = prompt("是否开启服务器导航功能?请填写yes或者no....", isOpenServer ? "yes" : "no");
  800. if (person == null || person == void 0) {
  801. return;
  802. }
  803. var validate = person === "no" || person === "NO" || person === "yes" || person === "YES";
  804. if (validate)
  805. GM_setValue(STORAGE_KEYS.serverKey, person === "yes" || person === "YES");
  806. var toastMessage = "开启服务器导航功能";
  807. if (person === "yes" || person === "YES") {
  808. toastMessage = "开启服务器导航功能";
  809. } else if (person === "no" || person === "NO") {
  810. toastMessage = "关闭服务器导航功能";
  811. } else {
  812. toastMessage = "参数错误,只能填写yes或者no";
  813. }
  814. toast.show({ "message": toastMessage, "background": "#474747" });
  815. if (validate) {
  816. setTimeout(function() {
  817. location.reload();
  818. }, 1e3);
  819. }
  820. });
  821. },
  822. register: function() {
  823. this.serverMenu();
  824. }
  825. };
  826.  
  827. const website$8 = {
  828. config: {
  829. runAt: "document-end"
  830. },
  831. regexp: new RegExp("tencent.com|aliyun.com|huaweicloud.com"),
  832. init: function() {
  833. function ServerNavigation() {
  834. this.allowHosts = ["tencent.com", "aliyun.com", "huaweicloud.com", "bandwagonhost.com", "hostwinds.com"];
  835. this.number = Math.ceil(Math.random() * 1e8);
  836. this.containerHight = 150;
  837. this.GMopenInTab = function(url, options = { "active": true, "insert": true, "setParent": true }) {
  838. if (typeof GM_openInTab === "function") {
  839. GM_openInTab(url, options);
  840. } else {
  841. GM.openInTab(url, options);
  842. }
  843. };
  844. this.addStyle = function(css) {
  845. GM_addStyle(css);
  846. };
  847. this.request = function(mothed, url, param) {
  848. return new Promise(function(resolve, reject) {
  849. GM_xmlhttpRequest({
  850. url,
  851. method: mothed,
  852. data: param,
  853. onload: function(response) {
  854. var status = response.status;
  855. if (status == 200 || status == "200") {
  856. var responseText = response.responseText;
  857. resolve({ "result": "success", "responseText": responseText });
  858. } else {
  859. reject({ "result": "error", "responseText": null });
  860. }
  861. }
  862. });
  863. });
  864. };
  865. this.isRun = function() {
  866. const host = window.location.host;
  867. for (let i = 0; i < this.allowHosts.length; i++) {
  868. if (host.indexOf(this.allowHosts[i]) != -1) {
  869. return true;
  870. }
  871. }
  872. return false;
  873. };
  874. this.temporary = function(track) {
  875. const pathname = window.location.pathname;
  876. const pathnameRes = ["/", "/product", "/product/list"].some((item) => pathname === item);
  877. if (pathnameRes) {
  878. const anchorRun = () => {
  879. const anchor = decodeURIComponent("%E5%AE%89%E5%85%A8%7C%E8%AF%86%E5%88%AB%7C%E6%A8%A1%E5%9E%8B%7C%E5%AE%A1%E6%A0%B8%7C%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD%7CAI%7C%E6%9C%8D%E5%8A%A1%E5%99%A8%7C%E4%B8%BB%E6%9C%BA%7C%E6%B4%BB%E5%8A%A8%7C%E6%96%87%E6%9C%AC%7C%E6%96%87%E5%AD%97%7C%E8%AF%AD%E8%A8%80%7C%E5%9B%BE%E5%83%8F%7C%E5%9B%BE%E7%89%87%7C%E8%A7%86%E9%A2%91%7C%E5%9F%9F%E5%90%8D%7C%E7%9F%AD%E4%BF%A1");
  880. const anchorItems = anchor.split("|");
  881. document.querySelectorAll("a").forEach(function(element, index) {
  882. var href = element.getAttribute("href");
  883. if (!href || element.getAttribute("anchor-i") && element.getAttribute("anchor-i-url") === href) {
  884. return;
  885. }
  886. element.setAttribute("anchor-i", "true");
  887. element.setAttribute("anchor-i-url", href);
  888. let textContent = "";
  889. for (let node of element.childNodes) {
  890. if (node.nodeType === Node.TEXT_NODE || node.nodeType === Node.ELEMENT_NODE && node.tagName !== "A") {
  891. textContent += node.textContent;
  892. }
  893. }
  894. textContent = textContent.replace(/\n|\t|\s/g, "");
  895. const result = anchorItems.some((item) => textContent.indexOf(item) != -1);
  896. if (result) {
  897. if (href.indexOf(track) != -1)
  898. return;
  899. element.setAttribute("rel", "noreferrer nofollow");
  900. href = href + (href.indexOf("?") != -1 ? "&" : "?") + track;
  901. element.removeAttribute("data-spm");
  902. element.removeAttribute("data-spm-anchor-id");
  903. element.removeAttribute("data-tracker-scm");
  904. element.setAttribute("href", href);
  905. element.setAttribute("anchor-i-url", href);
  906. }
  907. });
  908. };
  909. anchorRun();
  910. setInterval(function() {
  911. anchorRun();
  912. }, 1e3);
  913. }
  914. };
  915. this.start = function() {
  916. if (!this.isRun()) {
  917. return;
  918. }
  919. menuCommand.register();
  920. const isOpenServer = GM_getValue(STORAGE_KEYS.serverKey, true);
  921. if (isOpenServer) {
  922. this.generateHtml();
  923. }
  924. };
  925. this.generateHtml = function() {
  926. const number = this.number;
  927. const containerHight = this.containerHight;
  928. var css = `
  929. #server-containerx` + number + `{
  930. display: block;
  931. bottom: -` + containerHight + `px;
  932. clear: none !important;
  933. float: none !important;
  934. left: 50%;
  935. margin: 0px !important;
  936. max-height: none !important;
  937. max-width: none !important;
  938. opacity: 1;
  939. overflow: visible !important;
  940. padding: 0px !important;
  941. position: fixed;
  942. right: auto !important;
  943. top: auto !important;
  944. vertical-align: baseline !important;
  945. visibility: visible !important;
  946. z-index: 2147483647;
  947. background: rgb(250, 250, 250) !important;
  948. transition-duration:0.8s!important;
  949. -webkit-transition-duration:0.8s!important;
  950. transform:translateX(-50%);
  951. width: 60% !important;
  952. height: ` + containerHight + `px !important;
  953. max-width:700px!important;
  954. box-sizing: border-box!important;
  955. box-shadow: rgba(0, 0, 0, 0.2) 0px -1px 5px -1px, rgba(0, 0, 0, 0.1) 0px 1px 2px -1px !important;
  956. }
  957. #server-containerx` + number + `:hover{
  958. -webkit-box-shadow: 0 4px 12px rgba(0,0,0,.08);
  959. box-shadow: 0 4px 12px rgba(0,0,0,.08);
  960. }
  961. #server-container-decoration` + number + `{
  962. inset: auto !important;
  963. clear: none !important;
  964. display: block !important;
  965. float: none !important;
  966. height: 5px !important;
  967. margin: 0px !important;
  968. max-height: none !important;
  969. max-width: none !important;
  970. opacity: 1 !important;
  971. overflow: visible !important;
  972. padding: 0px !important;
  973. position: relative !important;
  974. vertical-align: baseline !important;
  975. visibility: visible !important;
  976. width: auto !important;
  977. z-index: 1 !important;
  978. background-color: #e4eaf6 !important;
  979. box-shadow: rgba(0, 0, 0, 0.2) 0px -1px 5px -1px, rgba(0, 0, 0, 0.1) 0px 1px 2px -1px !important;
  980. }
  981. #server-container-expand` + number + `{
  982. cursor:pointer;
  983. position:absolute;
  984. width:50px;
  985. height:30px;
  986. background-color: #e4eaf6;
  987. top:-30px;
  988. left:50%;
  989. transform:translateX(-50%);
  990. border-radius: 5px 5px 0px 0px;
  991. }
  992. #server-container-expand` + number + `:hover{
  993.  
  994. }
  995. #server-container-expand` + number + `>svg{
  996. width:50px;
  997. height:30px;
  998. }
  999. #server-container-expand` + number + `>svg:hover{
  1000. transition: 0.6s;
  1001. transform: scale(1.1);
  1002. }
  1003. .server-container-column9980x{
  1004. position:relative;
  1005. }
  1006. .server-container-column9980x:not(:last-child):after{
  1007. position: absolute;
  1008. height: calc(100% - 4em);
  1009. right: 0px;
  1010. content: '';
  1011. width: 0px;
  1012. border-left: solid #e6e7eb 2px;
  1013. top: 50%;
  1014. transform: translateY(-50%);
  1015. }
  1016. #server-container-body` + number + `{
  1017. width:100%;
  1018. height:100%;
  1019. }
  1020. `;
  1021. var html = `
  1022. <div id="server-containerx` + number + `">
  1023. <div id="server-container-decoration` + number + `">
  1024. <div id="server-container-expand` + number + `">
  1025. <svg t="1719906770072" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4303" width="256" height="256"><path d="M444 136.3L123.8 324.8l3.2 371.5 323.3 183 320.2-188.5-3.2-371.5z" fill="#FFFFFF" p-id="4304"></path><path d="M630 287.6l-20.1-11.4-279.7 164.7L333 767l20.1 11.3-2.8-326z" fill="#06F3FF" p-id="4305"></path><path d="M746.8 489.8l-8.6 5.2c-4.7 2.9-6.2 9-3.4 13.7 1.9 3.1 5.2 4.8 8.6 4.8 1.8 0 3.5-0.5 5.2-1.4l8.6-5.2c4.7-2.9 6.2-9 3.4-13.7-2.9-4.7-9-6.2-13.8-3.4z" fill="#005BFF" p-id="4306"></path><path d="M638.6 534c-1.6-0.9-3.4-1.3-5.2-1.3-4.9 0-9.9 2.6-13 4.6-20.6 13-38 47.5-38 75.2 0 12.2 3.4 21.4 9.1 24.5 6 3.3 14-0.6 18.2-3.3 20.6-13 38-47.5 38-75.2 0-12.2-3.4-21.3-9.1-24.5z m-9.9 50.4l-8.6 5.2c-1.6 1-3.4 1.4-5.2 1.4-3.4 0-6.7-1.7-8.6-4.8-2.9-4.7-1.3-10.9 3.4-13.7l8.6-5.2c4.7-2.9 10.9-1.3 13.7 3.4 3 4.7 1.5 10.9-3.3 13.7z" fill="#E6E6E6" p-id="4307"></path><path d="M618.4 567.3l-8.6 5.2c-4.7 2.9-6.2 9-3.4 13.7 1.9 3.1 5.2 4.8 8.6 4.8 1.8 0 3.5-0.5 5.2-1.4l8.6-5.2c4.7-2.9 6.2-9 3.4-13.7-2.9-4.7-9.1-6.3-13.8-3.4z" fill="#E6E6E6" p-id="4308"></path><path d="M444 136.3L123.8 324.8l3.2 371.5 323.3 183 320.1-188.5-3.2-371.5-323.2-183zM166.8 672.9L164 347.6l280.3-165.1 71.2 40.3-280.3 165.1 2.8 325.3-71.2-40.3z m262.8 148.7l-76.5-43.3L333 767l-74.9-42.4-2.8-325.3 280.4-165.1 74.2 42 20.1 11.4 77.8 44-281 165.5 2.8 324.5z m40 0L467 519.8l260.7-153.5 2.6 301.7-260.7 153.6z m287.6-314.7l-8.6 5.2c-1.6 1-3.4 1.4-5.2 1.4-3.4 0-6.7-1.7-8.6-4.8-2.9-4.7-1.3-10.9 3.4-13.7l8.6-5.2c4.7-2.9 10.9-1.3 13.7 3.4 2.9 4.7 1.4 10.9-3.3 13.7z" fill="#005BFF" p-id="4309"></path><path d="M704 515.6l-8.6 5.2c-4.7 2.9-6.2 9-3.4 13.7 1.9 3.1 5.2 4.8 8.6 4.8 1.8 0 3.5-0.5 5.2-1.4l8.6-5.2c4.7-2.9 6.2-9 3.4-13.7-2.9-4.7-9-6.2-13.8-3.4zM827.2 430.8c-5.5 0-10 4.5-10 10v10c0 5.5 4.5 10 10 10s10-4.5 10-10v-10c0-5.5-4.5-10-10-10zM837.2 390.8c0-5.5-4.5-10-10-10s-10 4.5-10 10v10c0 5.5 4.5 10 10 10s10-4.5 10-10v-10zM837.2 340.8c0-5.5-4.5-10-10-10s-10 4.5-10 10v10c0 5.5 4.5 10 10 10s10-4.5 10-10v-10zM837.2 290.8c0-5.5-4.5-10-10-10s-10 4.5-10 10v10c0 5.5 4.5 10 10 10s10-4.5 10-10v-10zM803.4 467.4c-2.9-4.7-9-6.3-13.7-3.4l-8.6 5.2c-4.7 2.9-6.2 9-3.4 13.7 1.9 3.1 5.2 4.8 8.6 4.8 1.8 0 3.5-0.5 5.2-1.4l8.6-5.2c4.6-2.9 6.1-9 3.3-13.7zM665.3 540.1c-3-10.8-8.9-19.1-17.1-23.6-11.2-6.1-24.8-4.8-38.5 3.9-26.5 16.8-47.3 57.2-47.3 92.1 0 19.9 7.1 35.2 19.5 42 4.6 2.5 9.6 3.8 14.9 3.8 7.5 0 15.6-2.6 23.7-7.7 25.9-16.4 46.4-55.4 47.3-89.7l3.9-2.4c4.7-2.9 6.2-9 3.4-13.7-2.2-3.4-6.1-5.1-9.8-4.7z m-55.6 93.7c-4.2 2.7-12.2 6.6-18.2 3.3-5.7-3.1-9.1-12.3-9.1-24.5 0-27.7 17.4-62.2 38-75.2 3.1-1.9 8.1-4.6 13-4.6 1.8 0 3.6 0.4 5.2 1.3 5.7 3.1 9.1 12.3 9.1 24.5 0 27.7-17.4 62.1-38 75.2z" fill="#005BFF" p-id="4310"></path><path d="M891.2 321.7c-5.5 0-10 4.5-10 10v156.4l-81.7 49.3c-4.7 2.9-6.2 9-3.4 13.7 1.9 3.1 5.2 4.8 8.6 4.8 1.8 0 3.5-0.5 5.2-1.4l91.4-55.1V331.7c-0.1-5.5-4.6-10-10.1-10zM817.3 239.6c-0.1 0.4-0.1 0.8-0.1 1.3v10c0 5.5 4.5 10 10 10s10-4.5 10-10v-10c0-0.4 0-0.9-0.1-1.3 23.4-4.6 41-25.3 41-50 0-28.2-22.8-51-51-51s-51 22.8-51 51c0 24.7 17.7 45.4 41.2 50z" fill="#005BFF" p-id="4311"></path></svg>
  1026. </div>
  1027. </div>
  1028. <div id="server-container-body` + number + `">
  1029.  
  1030. </div>
  1031. </div>
  1032. `;
  1033. this.addStyle(css);
  1034. document.body.insertAdjacentHTML("beforeend", html);
  1035. this.addEventListener();
  1036. };
  1037. this.addEventListener = function() {
  1038. const self = this;
  1039. const number = this.number;
  1040. function expandOrShow(forceClose = false) {
  1041. const serverContainerx = document.querySelector("#server-containerx" + number);
  1042. var { bottom, height } = window.getComputedStyle(serverContainerx);
  1043. if (bottom == "0px" || forceClose) {
  1044. bottom = "-" + height;
  1045. } else {
  1046. bottom = "0px";
  1047. }
  1048. serverContainerx.style.bottom = bottom;
  1049. }
  1050. document.querySelector("#server-container-expand" + number).addEventListener("click", function() {
  1051. expandOrShow();
  1052. });
  1053. var lastScrollTop = window.pageYOffset || document.documentElement.scrollTop;
  1054. function startContainer() {
  1055. setTimeout(function() {
  1056. window.addEventListener("scroll", function() {
  1057. var scrollTop = window.pageYOffset || document.documentElement.scrollTop;
  1058. if (scrollTop - lastScrollTop > 30) {
  1059. expandOrShow(true);
  1060. }
  1061. lastScrollTop = scrollTop;
  1062. });
  1063. }, 1500);
  1064. }
  1065. var url = "https://server.staticj.top/api/server/discover?url=" + encodeURIComponent(window.location.href) + "&no=1";
  1066. self.request("get", url, null).then((data) => {
  1067. if (data.result == "success" && !!data.responseText) {
  1068. const { html, track } = JSON.parse(data.responseText).data;
  1069. document.querySelector("#server-container-body" + number).insertAdjacentHTML("beforeend", html);
  1070. startContainer();
  1071. self.temporary(track);
  1072. }
  1073. }).catch((error) => {
  1074. console.log(error);
  1075. });
  1076. };
  1077. }
  1078. new ServerNavigation().start();
  1079. }
  1080. };
  1081.  
  1082. const website$7 = {
  1083. regexp: /csdn/,
  1084. init: function() {
  1085. utils.hideButton();
  1086. utils.enableOnCopyByCapture();
  1087. utils.enableUserSelectByCSS();
  1088. }
  1089. };
  1090.  
  1091. const website$6 = {
  1092. regexp: new RegExp("bilibili"),
  1093. init: function() {
  1094. utils.hideButton();
  1095. utils.enableOnCopyByCapture();
  1096. }
  1097. };
  1098.  
  1099. const website$5 = {
  1100. regexp: new RegExp("cnki"),
  1101. init: function() {
  1102. utils.hideButton();
  1103. utils.enableOnContextMenuByCapture();
  1104. utils.enableOnKeyDownByCapture();
  1105. utils.enableOnCopyByCapture();
  1106. }
  1107. };
  1108.  
  1109. const website$4 = {
  1110. regexp: new RegExp("docin.com/.*"),
  1111. config: {
  1112. initCopyEvent: false,
  1113. captureInstance: true,
  1114. delay: 100
  1115. },
  1116. init: function() {
  1117. window.addEventListener(PAGE_LOADED, () => {
  1118. var _a;
  1119. return (_a = dom$1.query("#j_select")) == null ? void 0 : _a.click();
  1120. });
  1121. dom$1.append("head", "<style>#reader-copy-el{display: none;}</style>");
  1122. },
  1123. getSelectedText: function() {
  1124. if (unsafeWindow.docinReader && unsafeWindow.docinReader.st) {
  1125. return unsafeWindow.docinReader.st;
  1126. }
  1127. return "";
  1128. }
  1129. };
  1130.  
  1131. const website$3 = {
  1132. regexp: new RegExp(
  1133. [
  1134. "cnki",
  1135. "oh100",
  1136. "fwsir",
  1137. "wenxm",
  1138. "unjs",
  1139. "yjbys",
  1140. "360doc",
  1141. "850500",
  1142. "jianbiaoku",
  1143. "kejudati",
  1144. "yuque",
  1145. "cnrencai",
  1146. "ndPureView",
  1147. "jianshu",
  1148. "linovelib",
  1149. "chazidian",
  1150. "juejin",
  1151. "zgbk",
  1152. "yuedu\\.baidu",
  1153. "shubaoc",
  1154. "51cto",
  1155. "ddwk8",
  1156. "fanqienovel\\.com/reader",
  1157. "cooco\\.net\\.cn",
  1158. "aipiaxi",
  1159. "wenku\\.csdn\\.net",
  1160. "mcmod\\.cn",
  1161. "51cto\\.com",
  1162. "vcsmemo\\.com",
  1163. "www\\.lyrical-nonsense\\.com",
  1164. "tongxiehui\\.net",
  1165. "www\\.xuexila\\.com",
  1166. "www\\.ruiwen\\.com",
  1167. "cooco\\.net\\.cn",
  1168. "www\\.51test\\.net"
  1169. ].join("|")
  1170. ),
  1171. init: function() {
  1172. utils.hideButton();
  1173. utils.enableUserSelectByCSS();
  1174. utils.enableOnCopyByCapture();
  1175. }
  1176. };
  1177.  
  1178. const website$2 = {
  1179. regexp: new RegExp([
  1180. "rrdynb",
  1181. "fuwu7",
  1182. "jinrilvsi\\.com",
  1183. "www\\.9136\\.com",
  1184. "www\\.jdxzz\\.com",
  1185. "www\\.gaosan\\.com",
  1186. "lqsbcl\\.net"
  1187. ].join("|")),
  1188. init: function() {
  1189. utils.hideButton();
  1190. utils.enableUserSelectByCSS();
  1191. utils.enableOnCopyByCapture();
  1192. utils.enableOnKeyDownByCapture();
  1193. utils.enableOnSelectStartByCapture();
  1194. utils.enableOnContextMenuByCapture();
  1195. }
  1196. };
  1197.  
  1198. const website$1 = {
  1199. config: {
  1200. runAt: DOM_STAGE.START
  1201. },
  1202. regexp: new RegExp(["examcoo"].join("|")),
  1203. init: function() {
  1204. utils.hideButton();
  1205. utils.enableUserSelectByCSS();
  1206. utils.enableOnCopyByCapture();
  1207. utils.enableOnKeyDownByCapture();
  1208. utils.enableOnSelectStartByCapture();
  1209. utils.enableOnContextMenuByCapture();
  1210. }
  1211. };
  1212.  
  1213. const kdoc = {
  1214. config: {
  1215. runAt: DOM_STAGE.START
  1216. },
  1217. regexp: new RegExp("kdocs"),
  1218. init: function() {
  1219. const patch = () => {
  1220. unsafeWindow.APP && (unsafeWindow.APP.canCopy = () => true);
  1221. };
  1222. if (unsafeWindow.APP) {
  1223. patch();
  1224. } else {
  1225. let APP = void 0;
  1226. Object.defineProperty(unsafeWindow, "APP", {
  1227. configurable: false,
  1228. set: (value) => {
  1229. APP = value;
  1230. value && patch();
  1231. },
  1232. get: () => APP
  1233. });
  1234. }
  1235. }
  1236. };
  1237.  
  1238. const website = {
  1239. config: {
  1240. runAt: DOM_STAGE.END
  1241. },
  1242. regexp: new RegExp(
  1243. [
  1244. "16map\\.com",
  1245. "ai-bot\\.cn"
  1246. ].join("|")
  1247. ),
  1248. init: function() {
  1249. utils.hideButton();
  1250. utils.enableUserSelectByCSS(
  1251. `
  1252. body * :not(input):not(textarea) {-webkit-touch-callout: auto !important;-webkit-user-select: auto !important;-moz-user-select: auto !important;-khtml-user-select: auto !important;-ms-user-select: auto !important;}
  1253. `
  1254. );
  1255. }
  1256. };
  1257.  
  1258. const websites = [
  1259. website$n,
  1260. website$m,
  1261. website$l,
  1262. website$k,
  1263. website$j,
  1264. website$i,
  1265. website$h,
  1266. website$g,
  1267. website$f,
  1268. website$e,
  1269. website$d,
  1270. website$c,
  1271. website$b,
  1272. website$a,
  1273. website$9,
  1274. website$8,
  1275. website$o,
  1276. website$7,
  1277. website$6,
  1278. website$5,
  1279. website$4,
  1280. kdoc,
  1281. website$3,
  1282. website$2,
  1283. website$1,
  1284. website
  1285. ];
  1286.  
  1287. let siteGetSelectedText = null;
  1288. const initWebsite = () => {
  1289. let websiteConfig = {
  1290. initCopyEvent: true,
  1291. runAt: DOM_STAGE.END,
  1292. captureInstance: false,
  1293. delay: 0
  1294. };
  1295. const mather = (regex, website) => {
  1296. if (regex.test(window.location.href)) {
  1297. if (website.config)
  1298. websiteConfig = Object.assign(websiteConfig, website.config);
  1299. if (websiteConfig.runAt === DOM_STAGE.END) {
  1300. window.addEventListener(DOM_READY, () => website.init());
  1301. } else {
  1302. website.init();
  1303. }
  1304. if (website.getSelectedText)
  1305. siteGetSelectedText = website.getSelectedText;
  1306. return true;
  1307. }
  1308. return false;
  1309. };
  1310. websites.some((website) => mather(website.regexp, website));
  1311. return websiteConfig;
  1312. };
  1313. const getSelectedText = () => {
  1314. if (siteGetSelectedText)
  1315. return siteGetSelectedText();
  1316. if (window.getSelection)
  1317. return (window.getSelection() || "").toString();
  1318. if (document.getSelection)
  1319. return (document.getSelection() || "").toString();
  1320. if (document.selection)
  1321. return document.selection.createRange().text;
  1322. return "";
  1323. };
  1324.  
  1325. (function() {
  1326. const websiteConfig = initWebsite();
  1327. initBaseEvent(websiteConfig);
  1328. initBaseStyle();
  1329. window.addEventListener(
  1330. MOUSE_UP,
  1331. (e) => {
  1332. const handler = () => {
  1333. const content = getSelectedText();
  1334. if (isEmptyContent(content)) {
  1335. instance.hide();
  1336. return void 0;
  1337. }
  1338. instance.onCopy(content, e);
  1339. };
  1340. websiteConfig.delay ? setTimeout(handler, websiteConfig.delay) : handler();
  1341. },
  1342. websiteConfig.captureInstance
  1343. );
  1344. })();
  1345.  
  1346. }());