博客整治

帮助你获得一致的博客阅读体验

ของเมื่อวันที่ 01-12-2021 ดู เวอร์ชันล่าสุด

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey, Greasemonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

  1. // ==UserScript==
  2. // @name 博客整治
  3. // @version 0.0.2
  4. // @description 帮助你获得一致的博客阅读体验
  5. // @author gausszhou@qq.com
  6. // @namespace gausszhou
  7. // @grant none
  8. // @run-at document-start
  9. // @icon https://gausszhou.top/graph/favicon.ico
  10. // @license MIT
  11. // @require https://cdn.bootcdn.net/ajax/libs/jquery/1.10.0/jquery.min.js
  12. // @include *://blog.csdn.net/*
  13. // @include *://www.cnblogs.com/*
  14. // @include *://juejin.cn/*
  15. // @supportURL https://github.com/gausszhou/user-scripts
  16. // @homepageURL https://github.com/gausszhou/user-scripts
  17. // ==/UserScript==
  18.  
  19. /******/ (() => { // webpackBootstrap
  20. /******/ "use strict";
  21. /******/ var __webpack_modules__ = ({
  22.  
  23. /***/ 265:
  24. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  25.  
  26. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  27. /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
  28. /* harmony export */ });
  29. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(601);
  30. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
  31. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(609);
  32. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  33. // Imports
  34.  
  35.  
  36. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
  37. // Module
  38. ___CSS_LOADER_EXPORT___.push([module.id, "body{display:none}.csdn ul.csdn-toolbar-fl,.csdn .toolbar-container-right,.csdn .blog-footer-bottom{display:none !important}.csdn.menu .csdn-side-toolbar,.csdn.menu .user-spm-list,.csdn.menu .user-influence-list,.csdn.menu .user-achievement,.csdn.menu #asideProfile{display:none !important}.csdn.menu .user-profile-head-banner{height:20px !important}.csdn.article #asideProfile,.csdn.article #asideCategory,.csdn.article #asideNewComments,.csdn.article #asideNewNps,.csdn.article #asideArchive,.csdn.article #asideHotArticle,.csdn.article #asideSearchArticle,.csdn.article #asideCustom,.csdn.article #asidedirectory,.csdn.article #btnMoreComment,.csdn.article .aside-content,.csdn.article .recommend-box,.csdn.article .toolbar-advert{display:none !important}.csdn #csdn-toolbar{position:fixed !important;z-index:9999;top:0 !important;width:100%}.csdn blockquote{margin:0.5em !important;padding:1em !important;border-left:5px solid #005282 !important;background-color:#f4f4f4 !important;color:#1b1b1b !important}.csdn.menu .user-profile-head{margin-top:3.5em}.csdn.category header>.container{margin-top:50px}.csdn.article .main_father{max-width:800px;margin:0 auto}.csdn.article .blog-content-box{margin-top:4em}.csdn.article .template-box{margin-bottom:1em}.cnblog{min-width:768px}.cnblog #rss{display:none !important}.cnblog #container{min-width:0 !important}.cnblog #lnkBlogTitle,.cnblog #cb_post_title_url{font-size:32px}.cnblog #content{margin:0 auto !important;max-width:740px}.cnblog #sidebar{display:none !important}.juejin .sidebar-bd-entry,.juejin .app-download-sidebar-block .recommend-box,.juejin .recommended-area{display:none !important}\n", ""]);
  39. // Exports
  40. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  41.  
  42.  
  43. /***/ }),
  44.  
  45. /***/ 609:
  46. /***/ ((module) => {
  47.  
  48.  
  49.  
  50. /*
  51. MIT License http://www.opensource.org/licenses/mit-license.php
  52. Author Tobias Koppers @sokra
  53. */
  54. module.exports = function (cssWithMappingToString) {
  55. var list = []; // return the list of modules as css string
  56.  
  57. list.toString = function toString() {
  58. return this.map(function (item) {
  59. var content = "";
  60. var needLayer = typeof item[5] !== "undefined";
  61.  
  62. if (item[4]) {
  63. content += "@supports (".concat(item[4], ") {");
  64. }
  65.  
  66. if (item[2]) {
  67. content += "@media ".concat(item[2], " {");
  68. }
  69.  
  70. if (needLayer) {
  71. content += "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {");
  72. }
  73.  
  74. content += cssWithMappingToString(item);
  75.  
  76. if (needLayer) {
  77. content += "}";
  78. }
  79.  
  80. if (item[2]) {
  81. content += "}";
  82. }
  83.  
  84. if (item[4]) {
  85. content += "}";
  86. }
  87.  
  88. return content;
  89. }).join("");
  90. }; // import a list of modules into the list
  91.  
  92.  
  93. list.i = function i(modules, media, dedupe, supports, layer) {
  94. if (typeof modules === "string") {
  95. modules = [[null, modules, undefined]];
  96. }
  97.  
  98. var alreadyImportedModules = {};
  99.  
  100. if (dedupe) {
  101. for (var k = 0; k < this.length; k++) {
  102. var id = this[k][0];
  103.  
  104. if (id != null) {
  105. alreadyImportedModules[id] = true;
  106. }
  107. }
  108. }
  109.  
  110. for (var _k = 0; _k < modules.length; _k++) {
  111. var item = [].concat(modules[_k]);
  112.  
  113. if (dedupe && alreadyImportedModules[item[0]]) {
  114. continue;
  115. }
  116.  
  117. if (typeof layer !== "undefined") {
  118. if (typeof item[5] === "undefined") {
  119. item[5] = layer;
  120. } else {
  121. item[1] = "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {").concat(item[1], "}");
  122. item[5] = layer;
  123. }
  124. }
  125.  
  126. if (media) {
  127. if (!item[2]) {
  128. item[2] = media;
  129. } else {
  130. item[1] = "@media ".concat(item[2], " {").concat(item[1], "}");
  131. item[2] = media;
  132. }
  133. }
  134.  
  135. if (supports) {
  136. if (!item[4]) {
  137. item[4] = "".concat(supports);
  138. } else {
  139. item[1] = "@supports (".concat(item[4], ") {").concat(item[1], "}");
  140. item[4] = supports;
  141. }
  142. }
  143.  
  144. list.push(item);
  145. }
  146. };
  147.  
  148. return list;
  149. };
  150.  
  151. /***/ }),
  152.  
  153. /***/ 601:
  154. /***/ ((module) => {
  155.  
  156.  
  157.  
  158. module.exports = function (i) {
  159. return i[1];
  160. };
  161.  
  162. /***/ }),
  163.  
  164. /***/ 62:
  165. /***/ ((module) => {
  166.  
  167.  
  168.  
  169. var stylesInDOM = [];
  170.  
  171. function getIndexByIdentifier(identifier) {
  172. var result = -1;
  173.  
  174. for (var i = 0; i < stylesInDOM.length; i++) {
  175. if (stylesInDOM[i].identifier === identifier) {
  176. result = i;
  177. break;
  178. }
  179. }
  180.  
  181. return result;
  182. }
  183.  
  184. function modulesToDom(list, options) {
  185. var idCountMap = {};
  186. var identifiers = [];
  187.  
  188. for (var i = 0; i < list.length; i++) {
  189. var item = list[i];
  190. var id = options.base ? item[0] + options.base : item[0];
  191. var count = idCountMap[id] || 0;
  192. var identifier = "".concat(id, " ").concat(count);
  193. idCountMap[id] = count + 1;
  194. var indexByIdentifier = getIndexByIdentifier(identifier);
  195. var obj = {
  196. css: item[1],
  197. media: item[2],
  198. sourceMap: item[3],
  199. supports: item[4],
  200. layer: item[5]
  201. };
  202.  
  203. if (indexByIdentifier !== -1) {
  204. stylesInDOM[indexByIdentifier].references++;
  205. stylesInDOM[indexByIdentifier].updater(obj);
  206. } else {
  207. var updater = addElementStyle(obj, options);
  208. options.byIndex = i;
  209. stylesInDOM.splice(i, 0, {
  210. identifier: identifier,
  211. updater: updater,
  212. references: 1
  213. });
  214. }
  215.  
  216. identifiers.push(identifier);
  217. }
  218.  
  219. return identifiers;
  220. }
  221.  
  222. function addElementStyle(obj, options) {
  223. var api = options.domAPI(options);
  224. api.update(obj);
  225.  
  226. var updater = function updater(newObj) {
  227. if (newObj) {
  228. if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {
  229. return;
  230. }
  231.  
  232. api.update(obj = newObj);
  233. } else {
  234. api.remove();
  235. }
  236. };
  237.  
  238. return updater;
  239. }
  240.  
  241. module.exports = function (list, options) {
  242. options = options || {};
  243. list = list || [];
  244. var lastIdentifiers = modulesToDom(list, options);
  245. return function update(newList) {
  246. newList = newList || [];
  247.  
  248. for (var i = 0; i < lastIdentifiers.length; i++) {
  249. var identifier = lastIdentifiers[i];
  250. var index = getIndexByIdentifier(identifier);
  251. stylesInDOM[index].references--;
  252. }
  253.  
  254. var newLastIdentifiers = modulesToDom(newList, options);
  255.  
  256. for (var _i = 0; _i < lastIdentifiers.length; _i++) {
  257. var _identifier = lastIdentifiers[_i];
  258.  
  259. var _index = getIndexByIdentifier(_identifier);
  260.  
  261. if (stylesInDOM[_index].references === 0) {
  262. stylesInDOM[_index].updater();
  263.  
  264. stylesInDOM.splice(_index, 1);
  265. }
  266. }
  267.  
  268. lastIdentifiers = newLastIdentifiers;
  269. };
  270. };
  271.  
  272. /***/ }),
  273.  
  274. /***/ 793:
  275. /***/ ((module) => {
  276.  
  277.  
  278.  
  279. var memo = {};
  280. /* istanbul ignore next */
  281.  
  282. function getTarget(target) {
  283. if (typeof memo[target] === "undefined") {
  284. var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself
  285.  
  286. if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
  287. try {
  288. // This will throw an exception if access to iframe is blocked
  289. // due to cross-origin restrictions
  290. styleTarget = styleTarget.contentDocument.head;
  291. } catch (e) {
  292. // istanbul ignore next
  293. styleTarget = null;
  294. }
  295. }
  296.  
  297. memo[target] = styleTarget;
  298. }
  299.  
  300. return memo[target];
  301. }
  302. /* istanbul ignore next */
  303.  
  304.  
  305. function insertBySelector(insert, style) {
  306. var target = getTarget(insert);
  307.  
  308. if (!target) {
  309. throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
  310. }
  311.  
  312. target.appendChild(style);
  313. }
  314.  
  315. module.exports = insertBySelector;
  316.  
  317. /***/ }),
  318.  
  319. /***/ 173:
  320. /***/ ((module) => {
  321.  
  322.  
  323.  
  324. /* istanbul ignore next */
  325. function insertStyleElement(options) {
  326. var element = document.createElement("style");
  327. options.setAttributes(element, options.attributes);
  328. options.insert(element, options.options);
  329. return element;
  330. }
  331.  
  332. module.exports = insertStyleElement;
  333.  
  334. /***/ }),
  335.  
  336. /***/ 892:
  337. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  338.  
  339.  
  340.  
  341. /* istanbul ignore next */
  342. function setAttributesWithoutAttributes(styleElement) {
  343. var nonce = true ? __webpack_require__.nc : 0;
  344.  
  345. if (nonce) {
  346. styleElement.setAttribute("nonce", nonce);
  347. }
  348. }
  349.  
  350. module.exports = setAttributesWithoutAttributes;
  351.  
  352. /***/ }),
  353.  
  354. /***/ 36:
  355. /***/ ((module) => {
  356.  
  357.  
  358.  
  359. /* istanbul ignore next */
  360. function apply(styleElement, options, obj) {
  361. var css = "";
  362.  
  363. if (obj.supports) {
  364. css += "@supports (".concat(obj.supports, ") {");
  365. }
  366.  
  367. if (obj.media) {
  368. css += "@media ".concat(obj.media, " {");
  369. }
  370.  
  371. var needLayer = typeof obj.layer !== "undefined";
  372.  
  373. if (needLayer) {
  374. css += "@layer".concat(obj.layer.length > 0 ? " ".concat(obj.layer) : "", " {");
  375. }
  376.  
  377. css += obj.css;
  378.  
  379. if (needLayer) {
  380. css += "}";
  381. }
  382.  
  383. if (obj.media) {
  384. css += "}";
  385. }
  386.  
  387. if (obj.supports) {
  388. css += "}";
  389. }
  390.  
  391. var sourceMap = obj.sourceMap;
  392.  
  393. if (sourceMap && typeof btoa !== "undefined") {
  394. css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
  395. } // For old IE
  396.  
  397. /* istanbul ignore if */
  398.  
  399.  
  400. options.styleTagTransform(css, styleElement, options.options);
  401. }
  402.  
  403. function removeStyleElement(styleElement) {
  404. // istanbul ignore if
  405. if (styleElement.parentNode === null) {
  406. return false;
  407. }
  408.  
  409. styleElement.parentNode.removeChild(styleElement);
  410. }
  411. /* istanbul ignore next */
  412.  
  413.  
  414. function domAPI(options) {
  415. var styleElement = options.insertStyleElement(options);
  416. return {
  417. update: function update(obj) {
  418. apply(styleElement, options, obj);
  419. },
  420. remove: function remove() {
  421. removeStyleElement(styleElement);
  422. }
  423. };
  424. }
  425.  
  426. module.exports = domAPI;
  427.  
  428. /***/ }),
  429.  
  430. /***/ 464:
  431. /***/ ((module) => {
  432.  
  433.  
  434.  
  435. /* istanbul ignore next */
  436. function styleTagTransform(css, styleElement) {
  437. if (styleElement.styleSheet) {
  438. styleElement.styleSheet.cssText = css;
  439. } else {
  440. while (styleElement.firstChild) {
  441. styleElement.removeChild(styleElement.firstChild);
  442. }
  443.  
  444. styleElement.appendChild(document.createTextNode(css));
  445. }
  446. }
  447.  
  448. module.exports = styleTagTransform;
  449.  
  450. /***/ })
  451.  
  452. /******/ });
  453. /************************************************************************/
  454. /******/ // The module cache
  455. /******/ var __webpack_module_cache__ = {};
  456. /******/
  457. /******/ // The require function
  458. /******/ function __webpack_require__(moduleId) {
  459. /******/ // Check if module is in cache
  460. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  461. /******/ if (cachedModule !== undefined) {
  462. /******/ return cachedModule.exports;
  463. /******/ }
  464. /******/ // Create a new module (and put it into the cache)
  465. /******/ var module = __webpack_module_cache__[moduleId] = {
  466. /******/ id: moduleId,
  467. /******/ // no module.loaded needed
  468. /******/ exports: {}
  469. /******/ };
  470. /******/
  471. /******/ // Execute the module function
  472. /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
  473. /******/
  474. /******/ // Return the exports of the module
  475. /******/ return module.exports;
  476. /******/ }
  477. /******/
  478. /************************************************************************/
  479. /******/ /* webpack/runtime/compat get default export */
  480. /******/ (() => {
  481. /******/ // getDefaultExport function for compatibility with non-harmony modules
  482. /******/ __webpack_require__.n = (module) => {
  483. /******/ var getter = module && module.__esModule ?
  484. /******/ () => (module['default']) :
  485. /******/ () => (module);
  486. /******/ __webpack_require__.d(getter, { a: getter });
  487. /******/ return getter;
  488. /******/ };
  489. /******/ })();
  490. /******/
  491. /******/ /* webpack/runtime/define property getters */
  492. /******/ (() => {
  493. /******/ // define getter functions for harmony exports
  494. /******/ __webpack_require__.d = (exports, definition) => {
  495. /******/ for(var key in definition) {
  496. /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  497. /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  498. /******/ }
  499. /******/ }
  500. /******/ };
  501. /******/ })();
  502. /******/
  503. /******/ /* webpack/runtime/hasOwnProperty shorthand */
  504. /******/ (() => {
  505. /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
  506. /******/ })();
  507. /******/
  508. /************************************************************************/
  509. var __webpack_exports__ = {};
  510. // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
  511. (() => {
  512.  
  513. // EXTERNAL MODULE: ../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
  514. var injectStylesIntoStyleTag = __webpack_require__(62);
  515. var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
  516. // EXTERNAL MODULE: ../../node_modules/style-loader/dist/runtime/styleDomAPI.js
  517. var styleDomAPI = __webpack_require__(36);
  518. var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
  519. // EXTERNAL MODULE: ../../node_modules/style-loader/dist/runtime/insertBySelector.js
  520. var insertBySelector = __webpack_require__(793);
  521. var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
  522. // EXTERNAL MODULE: ../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
  523. var setAttributesWithoutAttributes = __webpack_require__(892);
  524. var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
  525. // EXTERNAL MODULE: ../../node_modules/style-loader/dist/runtime/insertStyleElement.js
  526. var insertStyleElement = __webpack_require__(173);
  527. var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
  528. // EXTERNAL MODULE: ../../node_modules/style-loader/dist/runtime/styleTagTransform.js
  529. var styleTagTransform = __webpack_require__(464);
  530. var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
  531. // EXTERNAL MODULE: ../../node_modules/css-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js!./src/assets/styles/index.scss
  532. var styles = __webpack_require__(265);
  533. ;// CONCATENATED MODULE: ./src/assets/styles/index.scss
  534.  
  535.  
  536. var options = {};
  537.  
  538. options.styleTagTransform = (styleTagTransform_default());
  539. options.setAttributes = (setAttributesWithoutAttributes_default());
  540.  
  541. options.insert = insertBySelector_default().bind(null, "head");
  542. options.domAPI = (styleDomAPI_default());
  543. options.insertStyleElement = (insertStyleElement_default());
  544.  
  545. var update = injectStylesIntoStyleTag_default()(styles/* default */.Z, options);
  546.  
  547.  
  548.  
  549.  
  550. /* harmony default export */ const assets_styles = (styles/* default */.Z && styles/* default.locals */.Z.locals ? styles/* default.locals */.Z.locals : undefined);
  551.  
  552. ;// CONCATENATED MODULE: ./src/components/ui.js
  553. let dq = document.querySelector.bind(document);
  554.  
  555. function UI() {
  556. this.init();
  557. }
  558.  
  559. UI.prototype.init = function () {
  560. console.log("欢迎使用博客整治插件");
  561. };
  562.  
  563. UI.prototype.mounted = function () {
  564. this.body = document.body;
  565. };
  566.  
  567. UI.prototype.processRemoveAD = function () {
  568. if (this.ads && this.ads.length) {
  569. console.log(this.ads.length);
  570. this.ads.forEach((selector) => {
  571. let ad = dq(selector);
  572. console.log(ad);
  573. if (ad) ad.parentElement.removeChild(ad);
  574. });
  575. }
  576. };
  577.  
  578. UI.prototype.process = function () {
  579. this.processRemoveAD();
  580. this.mode = "home";
  581. if (this.blog_content) {
  582. this.mode = "article";
  583. } else {
  584. this.mode = "menu";
  585. }
  586. this.body.classList.add(this.mode);
  587. };
  588.  
  589. UI.prototype.csdn = function () {
  590. this.body.classList.add("csdn");
  591. if (window.location.href.includes("category")) {
  592. this.body.classList.add("category");
  593. }
  594. this.blog_content = dq("#article_content");
  595. if (this.blog_content) {
  596. this.blog_content.classList.add("markdown-body");
  597. }
  598. this.ads = [".csdn-side-toolbar", "#asideHotArticle", "#asideArchive"];
  599. this.process();
  600. this.processCSDN();
  601. };
  602.  
  603. UI.prototype.cnblog = function () {
  604. this.body.classList.add("cnblog");
  605. this.blog_content = dq(".post_detail");
  606. if (this.blog_content) {
  607. this.blog_content.classList.add("markdown-body");
  608. }
  609. this.ads = [];
  610. this.process();
  611. };
  612.  
  613. UI.prototype.juejin = function () {
  614. this.body.classList.add("juejin");
  615. this.blog_content = dq(".article-area");
  616. if (this.blog_content) {
  617. this.blog_content.classList.add("markdown-body");
  618. }
  619. this.ads = [];
  620. this.process();
  621. };
  622.  
  623. UI.prototype.processCSDN = function () {
  624. window.onload = function () {
  625. // 去除剪贴板劫持
  626. csdn.copyright.textData = "";
  627. try {
  628. Object.defineProperty(window, "articleType", {
  629. value: 0,
  630. writable: false,
  631. configurable: false
  632. });
  633. $("#csdn-toolbar").css("border-bottom", "2px solid #409eff");
  634. } catch (err) {}
  635. // 修复无法复制
  636. $("pre").css("user-select", "auto");
  637. $("code").css("user-select", "auto");
  638. $("blockquote").css("user-select", "auto");
  639. // 免登录复制
  640. $(".hljs-button").removeClass("signin");
  641. $(".hljs-button").addClass("copy-button");
  642. $(".hljs-button").attr("onclick", "hljs.copyCode(event)");
  643. $(".hljs-button").attr("data-title", "免登录复制");
  644. setInterval(() => {
  645. $(".hljs-button").attr("data-title", "免登录复制");
  646. $(".passport-login-container").remove();
  647. }, 1000 / 60);
  648. };
  649. };
  650.  
  651. /* harmony default export */ const ui = (UI);
  652.  
  653. ;// CONCATENATED MODULE: ./src/main.js
  654.  
  655.  
  656.  
  657. let main_ui = new ui();
  658. (function () {
  659. window.addEventListener("DOMContentLoaded", function () {
  660. main_ui.mounted();
  661. let hostname = location.hostname;
  662. switch (hostname) {
  663. case "blog.csdn.net":
  664. main_ui.csdn();
  665. break;
  666. case "www.cnblogs.com":
  667. main_ui.cnblog();
  668. break;
  669. case "juejin.cn":
  670. main_ui.juejin();
  671. break;
  672. default:
  673. main_ui.csdn();
  674. break;
  675. }
  676. document.body.style.display = "block";
  677. });
  678. })();
  679.  
  680. })();
  681.  
  682. /******/ })()
  683. ;