0x3f-problem-solution

配合灵神题单解题

  1. // ==UserScript==
  2. // @name 0x3f-problem-solution
  3. // @namespace https://greatest.deepsurf.us/zh-CN/users/1326420-wuxin0012
  4. // @version 0.0.1
  5. // @author wuxin0011
  6. // @description 配合灵神题单解题
  7. // @license MIT
  8. // @icon https://assets.leetcode.cn/aliyun-lc-upload/users/endlesscheng/avatar_1690721039.png
  9. // @source https://greatest.deepsurf.us/zh-CN/users/1326420-wuxin0012
  10. // @match https://leetcode.cn/circle/discuss/*
  11. // @require https://cdn.jsdelivr.net/npm/vue@3.4.31/dist/vue.global.prod.js
  12. // @require data:application/javascript,%3Bwindow.Vue%3DVue%3B
  13. // @require https://unpkg.com/element-plus@2.7.6/dist/index.full.js
  14. // @resource elementPlusCss https://unpkg.com/element-plus@2.7.6/dist/index.css
  15. // @grant GM_addStyle
  16. // @grant GM_getResourceText
  17. // @grant GM_getValue
  18. // @grant GM_registerMenuCommand
  19. // @grant GM_setValue
  20. // ==/UserScript==
  21.  
  22. (t=>{if(typeof GM_addStyle=="function"){GM_addStyle(t);return}const e=document.createElement("style");e.textContent=t,document.head.append(e)})(" .m-setting-button[data-v-6d3b190f]{position:fixed;top:200px;right:0;z-index:100000} ");
  23.  
  24. (function (vue, ElementPlus) {
  25. 'use strict';
  26.  
  27. var _GM_getValue = /* @__PURE__ */ (() => typeof GM_getValue != "undefined" ? GM_getValue : void 0)();
  28. var _GM_registerMenuCommand = /* @__PURE__ */ (() => typeof GM_registerMenuCommand != "undefined" ? GM_registerMenuCommand : void 0)();
  29. var _GM_setValue = /* @__PURE__ */ (() => typeof GM_setValue != "undefined" ? GM_setValue : void 0)();
  30. const inf = 4e3;
  31. const mi = 1e3;
  32. const __0x3f_problmes_solution__ = "__0x3f_problmes_solution__";
  33. const __0x3f_problmes_urls__ = "__0x3f_problmes_urls__";
  34. const __0x3f_problmes_update__ = "__0x3f_problmes_update__";
  35. const __add_cur__ = "__add_cur__";
  36. const Problems = () => Array.from(document.querySelectorAll(".css-1ayia3m-MarkdownContent li>a"));
  37. const defaultObj = {
  38. min: mi,
  39. max: inf,
  40. visiableMember: true,
  41. onlyUrls: false,
  42. useDefaultSetting: true
  43. };
  44. function isShow(text, min, max) {
  45. if (!text) {
  46. return true;
  47. }
  48. let res = text.match(/\d+/ig);
  49. if (!res) {
  50. return true;
  51. }
  52. if (Array.isArray(res) && res.length < 2) {
  53. return true;
  54. }
  55. let s = 0;
  56. for (let i = res.length - 1; i >= 0; i--) {
  57. s = res[i];
  58. if (s >= mi && s <= inf) {
  59. return s >= min && s <= max;
  60. }
  61. }
  62. return true;
  63. }
  64. let A = Problems();
  65. function handlerProblem(data) {
  66. var _a;
  67. if (!Array.isArray(A) || Array.isArray(A) && A.length == 0) {
  68. A = Problems();
  69. }
  70. let { min, max, visiableMember, useDefaultSetting, onlyUrls } = data;
  71. if (isNaN(min) || isNaN(max)) {
  72. min = mi;
  73. max = inf;
  74. }
  75. if (min < mi) {
  76. min = mi;
  77. }
  78. if (max < min) {
  79. max = inf;
  80. }
  81. min = Number(min);
  82. max = Number(max);
  83. data.min = min;
  84. data.max = max;
  85. _GM_setValue(__0x3f_problmes_solution__, data);
  86. for (let i = 0; i < A.length; i++) {
  87. let d = (_a = A[i]) == null ? void 0 : _a.parentElement;
  88. if (!d) {
  89. continue;
  90. }
  91. let flag = isShow(d.textContent, min, max);
  92. d.style.display = flag ? "" : "none";
  93. let c = d.textContent && d.textContent.indexOf("会员") != -1;
  94. if (!c) {
  95. continue;
  96. }
  97. d.style.display = visiableMember ? "" : "none";
  98. }
  99. }
  100. const initUrls = () => _GM_getValue(__0x3f_problmes_update__) ? Array.isArray(_GM_getValue(__0x3f_problmes_urls__)) ? _GM_getValue(__0x3f_problmes_urls__) : [] : defaultUrls;
  101. const initObj = () => _GM_getValue(__0x3f_problmes_solution__) ? Object.assign(defaultObj, _GM_getValue(__0x3f_problmes_solution__)) : defaultObj;
  102. const support_plugins = () => {
  103. const u = initObj();
  104. if (!u || !u.onlyUrls) return true;
  105. const url = window.location.href;
  106. const urls = initUrls();
  107. for (let info of urls) {
  108. if (!info || !(info == null ? void 0 : info.link)) {
  109. continue;
  110. }
  111. console.log("url find", info.link.indexOf(url) != -1, info.link, url);
  112. if (info.link.indexOf(url) != -1) {
  113. return true;
  114. }
  115. }
  116. return false;
  117. };
  118. const defaultUrls = [
  119. {
  120. title: "滑动窗口(定长/不定长/多指针)",
  121. link: "https://leetcode.cn/circle/discuss/0viNMK/"
  122. },
  123. {
  124. title: "二分算法(二分答案/最小化最大值/最大化最小值/第K小)",
  125. link: "https://leetcode.cn/circle/discuss/SqopEo/"
  126. },
  127. {
  128. title: "单调栈(矩形面积/贡献法/最小字典序)",
  129. link: "https://leetcode.cn/circle/discuss/9oZFK9/"
  130. },
  131. {
  132. title: "网格图(DFS/BFS/综合应用)",
  133. link: "https://leetcode.cn/circle/discuss/YiXPXW/"
  134. },
  135. {
  136. title: "位运算(基础/性质/拆位/试填/恒等式/贪心/脑筋急转弯)",
  137. link: "https://leetcode.cn/circle/discuss/dHn9Vk/"
  138. },
  139. {
  140. title: "图论算法(DFS/BFS/拓扑排序/最短路/最小生成树/二分图/基环树/欧拉路径)",
  141. link: "https://leetcode.cn/circle/discuss/01LUak/"
  142. },
  143. {
  144. title: "动态规划(入门/背包/状态机/划分/区间/状压/数位/树形/数据结构优化)",
  145. link: "https://leetcode.cn/circle/discuss/tXLS3i/"
  146. },
  147. {
  148. title: "常用数据结构(前缀和/差分/栈/队列/堆/字典树/并查集/树状数组/线段树)",
  149. link: "https://leetcode.cn/circle/discuss/mOr1u6/"
  150. },
  151. {
  152. title: "数学算法(数论/组合/概率期望/博弈/计算几何/随机算法)",
  153. link: "https://leetcode.cn/circle/discuss/IYT3ss/"
  154. }
  155. ];
  156. const _export_sfc = (sfc, props) => {
  157. const target = sfc.__vccOpts || sfc;
  158. for (const [key, val] of props) {
  159. target[key] = val;
  160. }
  161. return target;
  162. };
  163. const _hoisted_1 = { class: "dialog-footer" };
  164. const formLabelWidth = "44px";
  165. const _sfc_main = {
  166. __name: "App",
  167. setup(__props) {
  168. const drawer = vue.ref(false);
  169. const fromData = vue.reactive(initObj());
  170. vue.watch(fromData, () => {
  171. handlerProblem(vue.toRaw(Object.assign({}, fromData)));
  172. });
  173. let tableData = vue.reactive(initUrls());
  174. const keywords = vue.ref("");
  175. const dialogTableVisible = vue.ref(false);
  176. const urlsData = vue.computed(() => tableData.filter((v) => v && v.title && v.title.indexOf(keywords.value) != -1));
  177. const dialogFormVisible = vue.ref(false);
  178. const info = vue.reactive({
  179. title: "",
  180. link: "",
  181. status: "add"
  182. });
  183. const addlocal = () => {
  184. let ok = false;
  185. for (let a of tableData) {
  186. if (a && a.link.indexOf(window.location.href) != -1) {
  187. ok = true;
  188. }
  189. }
  190. if (ok) {
  191. return;
  192. }
  193. tableData.unshift({ title: document.title, link: window.location.href });
  194. };
  195. const updateIndex = vue.ref(-1);
  196. const showProblems = () => {
  197. dialogTableVisible.value = true;
  198. if (_GM_getValue(__add_cur__)) {
  199. addlocal();
  200. }
  201. };
  202. const handlerProblems = (status, updateInfo = { title: "", link: "" }, index = -1) => {
  203. dialogFormVisible.value = true;
  204. info.status = status;
  205. updateIndex.value = index;
  206. Object.assign(info, updateInfo);
  207. };
  208. const handlerMessage = (u, title, link) => {
  209. const a = u ? "添加" : "修改";
  210. const error = !title || !/https?:\/\/.*/.test(link);
  211. if (error) {
  212. ElementPlus.ElMessage.error(`${a} 失败 请保证标题或者链接有效 `);
  213. } else {
  214. ElementPlus.ElMessage.success(`${a} 成功 `);
  215. }
  216. return !error;
  217. };
  218. const addOrUpdate = () => {
  219. if (!handlerMessage(info.status == "add", info.title, info.link)) {
  220. return;
  221. }
  222. if (info.status == "add") {
  223. tableData.unshift({ title: info.title, link: info.link });
  224. } else {
  225. let index = updateIndex.value;
  226. if (index != -1 && index < tableData.length) {
  227. tableData[index].link = info.link;
  228. tableData[index].title = info.title;
  229. }
  230. }
  231. dialogFormVisible.value = false;
  232. };
  233. const deleteProblems = (index) => {
  234. tableData.splice(index, 1);
  235. _GM_setValue(__0x3f_problmes_urls__, vue.toRaw(tableData));
  236. };
  237. const handlerDefault = () => {
  238. ElementPlus.ElMessageBox.confirm(
  239. "确认使用默认题单,将会重置题单?",
  240. "警告",
  241. {
  242. confirmButtonText: "确认",
  243. cancelButtonText: "取消",
  244. type: "warning"
  245. }
  246. ).then(() => {
  247. for (let i = 0; i < tableData.length; i++) {
  248. delete tableData[i];
  249. }
  250. for (let item of defaultUrls) {
  251. tableData.unshift(item);
  252. }
  253. ElementPlus.ElMessage({
  254. type: "success",
  255. message: "重置成功"
  256. });
  257. }).catch(() => {
  258. ElementPlus.ElMessage({
  259. type: "info",
  260. message: "取消重置"
  261. });
  262. });
  263. };
  264. window.addEventListener("beforeunload", () => {
  265. console.log("save ....");
  266. _GM_setValue(__0x3f_problmes_urls__, vue.toRaw(tableData));
  267. _GM_setValue(__0x3f_problmes_update__, true);
  268. _GM_setValue(__add_cur__, false);
  269. });
  270. vue.onMounted(() => {
  271. if (support_plugins()) {
  272. setTimeout(() => {
  273. handlerProblem(vue.toRaw(Object.assign({}, fromData)));
  274. }, 3e3);
  275. }
  276. });
  277. return (_ctx, _cache) => {
  278. const _component_el_button = vue.resolveComponent("el-button");
  279. const _component_el_input = vue.resolveComponent("el-input");
  280. const _component_el_col = vue.resolveComponent("el-col");
  281. const _component_el_form_item = vue.resolveComponent("el-form-item");
  282. const _component_el_switch = vue.resolveComponent("el-switch");
  283. const _component_el_tooltip = vue.resolveComponent("el-tooltip");
  284. const _component_el_form = vue.resolveComponent("el-form");
  285. const _component_el_divider = vue.resolveComponent("el-divider");
  286. const _component_el_row = vue.resolveComponent("el-row");
  287. const _component_el_link = vue.resolveComponent("el-link");
  288. const _component_el_table_column = vue.resolveComponent("el-table-column");
  289. const _component_el_table = vue.resolveComponent("el-table");
  290. const _component_el_dialog = vue.resolveComponent("el-dialog");
  291. const _component_el_drawer = vue.resolveComponent("el-drawer");
  292. return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
  293. vue.createElementVNode("div", null, [
  294. vue.createVNode(_component_el_button, {
  295. type: "primary",
  296. style: { "margin-left": "16px" },
  297. onClick: _cache[0] || (_cache[0] = ($event) => drawer.value = !drawer.value),
  298. class: "m-setting-button"
  299. }, {
  300. default: vue.withCtx(() => [
  301. vue.createTextVNode(" 设置 ")
  302. ]),
  303. _: 1
  304. })
  305. ]),
  306. vue.createVNode(_component_el_drawer, {
  307. modelValue: drawer.value,
  308. "onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => drawer.value = $event),
  309. "with-header": false,
  310. size: "30%"
  311. }, {
  312. default: vue.withCtx(() => [
  313. vue.createVNode(_component_el_form, {
  314. "label-position": "left",
  315. "label-width": "auto",
  316. model: fromData,
  317. style: { "max-width": "600px" }
  318. }, {
  319. default: vue.withCtx(() => [
  320. vue.createVNode(_component_el_form_item, { label: "分数区间" }, {
  321. default: vue.withCtx(() => [
  322. vue.createVNode(_component_el_col, { span: 10 }, {
  323. default: vue.withCtx(() => [
  324. vue.createVNode(_component_el_input, {
  325. modelValue: fromData.min,
  326. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => fromData.min = $event),
  327. "aria-placeholder": "",
  328. placeholder: " min "
  329. }, null, 8, ["modelValue"])
  330. ]),
  331. _: 1
  332. }),
  333. vue.createVNode(_component_el_col, {
  334. class: "text-center",
  335. span: 1,
  336. style: { "margin": "0 0.5rem" }
  337. }, {
  338. default: vue.withCtx(() => [
  339. vue.createTextVNode("-")
  340. ]),
  341. _: 1
  342. }),
  343. vue.createVNode(_component_el_col, { span: 10 }, {
  344. default: vue.withCtx(() => [
  345. vue.createVNode(_component_el_input, {
  346. modelValue: fromData.max,
  347. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => fromData.max = $event),
  348. "aria-placeholder": "",
  349. placeholder: " max"
  350. }, null, 8, ["modelValue"])
  351. ]),
  352. _: 1
  353. })
  354. ]),
  355. _: 1
  356. }),
  357. vue.createVNode(_component_el_form_item, { label: "显示会员题" }, {
  358. default: vue.withCtx(() => [
  359. vue.createVNode(_component_el_switch, {
  360. modelValue: fromData.visiableMember,
  361. "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => fromData.visiableMember = $event)
  362. }, null, 8, ["modelValue"])
  363. ]),
  364. _: 1
  365. }),
  366. vue.createVNode(_component_el_form_item, { label: "只在收藏题单中生效" }, {
  367. default: vue.withCtx(() => [
  368. vue.createVNode(_component_el_tooltip, {
  369. content: "插件只在收藏题单中生效,刷新生效 ",
  370. placement: "bottom-end"
  371. }, {
  372. default: vue.withCtx(() => [
  373. vue.createVNode(_component_el_switch, {
  374. modelValue: fromData.onlyUrls,
  375. "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => fromData.onlyUrls = $event)
  376. }, null, 8, ["modelValue"])
  377. ]),
  378. _: 1
  379. })
  380. ]),
  381. _: 1
  382. }),
  383. vue.createVNode(_component_el_form_item, { label: "使用题单" }, {
  384. default: vue.withCtx(() => [
  385. vue.createVNode(_component_el_switch, {
  386. modelValue: fromData.useDefaultSetting,
  387. "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => fromData.useDefaultSetting = $event)
  388. }, null, 8, ["modelValue"])
  389. ]),
  390. _: 1
  391. })
  392. ]),
  393. _: 1
  394. }, 8, ["model"]),
  395. fromData.useDefaultSetting ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  396. vue.createVNode(_component_el_divider),
  397. vue.createVNode(_component_el_button, {
  398. plain: "",
  399. onClick: showProblems
  400. }, {
  401. default: vue.withCtx(() => [
  402. vue.createTextVNode(" 查看收藏的题单 ")
  403. ]),
  404. _: 1
  405. }),
  406. vue.createVNode(_component_el_divider)
  407. ], 64)) : vue.createCommentVNode("", true),
  408. vue.createVNode(_component_el_dialog, {
  409. modelValue: dialogTableVisible.value,
  410. "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => dialogTableVisible.value = $event),
  411. title: "题单"
  412. }, {
  413. default: vue.withCtx(() => [
  414. vue.createVNode(_component_el_row, { gutter: 10 }, {
  415. default: vue.withCtx(() => [
  416. vue.createVNode(_component_el_col, { span: 8 }, {
  417. default: vue.withCtx(() => [
  418. vue.createVNode(_component_el_input, {
  419. modelValue: keywords.value,
  420. "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => keywords.value = $event),
  421. placeholder: "请输入关键词过滤",
  422. clearable: ""
  423. }, null, 8, ["modelValue"])
  424. ]),
  425. _: 1
  426. }),
  427. vue.createVNode(_component_el_col, { span: 16 }, {
  428. default: vue.withCtx(() => [
  429. vue.createVNode(_component_el_button, {
  430. plain: "",
  431. onClick: addlocal
  432. }, {
  433. default: vue.withCtx(() => [
  434. vue.createTextVNode(" 添加本页 ")
  435. ]),
  436. _: 1
  437. }),
  438. vue.createVNode(_component_el_button, {
  439. plain: "",
  440. onClick: _cache[7] || (_cache[7] = ($event) => handlerProblems("add"))
  441. }, {
  442. default: vue.withCtx(() => [
  443. vue.createTextVNode(" 自定义 ")
  444. ]),
  445. _: 1
  446. }),
  447. vue.createVNode(_component_el_button, {
  448. plain: "",
  449. onClick: handlerDefault
  450. }, {
  451. default: vue.withCtx(() => [
  452. vue.createTextVNode(" 默认 ")
  453. ]),
  454. _: 1
  455. })
  456. ]),
  457. _: 1
  458. })
  459. ]),
  460. _: 1
  461. }),
  462. vue.createVNode(_component_el_table, {
  463. data: urlsData.value,
  464. height: "300",
  465. style: { "width": "100%", "margin-top": "10px" }
  466. }, {
  467. default: vue.withCtx(() => [
  468. vue.createVNode(_component_el_table_column, {
  469. label: "标题",
  470. width: "auto",
  471. align: "center"
  472. }, {
  473. default: vue.withCtx((scope) => [
  474. vue.createVNode(_component_el_link, {
  475. href: scope.row.link,
  476. target: "_blank",
  477. type: "default"
  478. }, {
  479. default: vue.withCtx(() => [
  480. vue.createTextVNode(vue.toDisplayString(scope.row.title), 1)
  481. ]),
  482. _: 2
  483. }, 1032, ["href"])
  484. ]),
  485. _: 1
  486. }),
  487. vue.createVNode(_component_el_table_column, {
  488. label: "操作",
  489. width: "auto",
  490. align: "center"
  491. }, {
  492. default: vue.withCtx((scope) => [
  493. vue.createVNode(_component_el_button, {
  494. type: "primary",
  495. size: "small",
  496. onClick: ($event) => handlerProblems("update", scope.row, scope.$index)
  497. }, {
  498. default: vue.withCtx(() => [
  499. vue.createTextVNode("编辑")
  500. ]),
  501. _: 2
  502. }, 1032, ["onClick"]),
  503. vue.createVNode(_component_el_button, {
  504. type: "danger",
  505. size: "small",
  506. onClick: ($event) => deleteProblems(scope.$index)
  507. }, {
  508. default: vue.withCtx(() => [
  509. vue.createTextVNode("删除")
  510. ]),
  511. _: 2
  512. }, 1032, ["onClick"])
  513. ]),
  514. _: 1
  515. })
  516. ]),
  517. _: 1
  518. }, 8, ["data"])
  519. ]),
  520. _: 1
  521. }, 8, ["modelValue"]),
  522. vue.createVNode(_component_el_dialog, {
  523. modelValue: dialogFormVisible.value,
  524. "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => dialogFormVisible.value = $event),
  525. title: `${info.status == "add" ? "添加" : "编辑"}`,
  526. width: "400"
  527. }, {
  528. footer: vue.withCtx(() => [
  529. vue.createElementVNode("div", _hoisted_1, [
  530. vue.createVNode(_component_el_button, {
  531. onClick: _cache[11] || (_cache[11] = ($event) => dialogFormVisible.value = false)
  532. }, {
  533. default: vue.withCtx(() => [
  534. vue.createTextVNode("取消")
  535. ]),
  536. _: 1
  537. }),
  538. vue.createVNode(_component_el_button, {
  539. type: "primary",
  540. onClick: addOrUpdate
  541. }, {
  542. default: vue.withCtx(() => [
  543. vue.createTextVNode(" 确认 ")
  544. ]),
  545. _: 1
  546. })
  547. ])
  548. ]),
  549. default: vue.withCtx(() => [
  550. vue.createVNode(_component_el_form, null, {
  551. default: vue.withCtx(() => [
  552. vue.createVNode(_component_el_form_item, {
  553. label: "标题",
  554. "label-width": formLabelWidth
  555. }, {
  556. default: vue.withCtx(() => [
  557. vue.createVNode(_component_el_input, {
  558. modelValue: info.title,
  559. "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => info.title = $event),
  560. autocomplete: "off"
  561. }, null, 8, ["modelValue"])
  562. ]),
  563. _: 1
  564. }),
  565. vue.createVNode(_component_el_form_item, {
  566. label: "链接",
  567. "label-width": formLabelWidth
  568. }, {
  569. default: vue.withCtx(() => [
  570. vue.createVNode(_component_el_input, {
  571. modelValue: info.link,
  572. "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => info.link = $event),
  573. autocomplete: "off"
  574. }, null, 8, ["modelValue"])
  575. ]),
  576. _: 1
  577. })
  578. ]),
  579. _: 1
  580. })
  581. ]),
  582. _: 1
  583. }, 8, ["modelValue", "title"])
  584. ]),
  585. _: 1
  586. }, 8, ["modelValue"])
  587. ], 64);
  588. };
  589. }
  590. };
  591. const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-6d3b190f"]]);
  592. const cssLoader = (e) => {
  593. const t = GM_getResourceText(e);
  594. return GM_addStyle(t), t;
  595. };
  596. cssLoader("elementPlusCss");
  597. let Container = null;
  598. const VueApp = vue.createApp(App);
  599. const start = () => {
  600. Container = document.createElement("div");
  601. const body = document.querySelector("body");
  602. body.append(Container);
  603. Container.style.display = support_plugins() ? "block" : "none";
  604. return Container;
  605. };
  606. VueApp.use(ElementPlus).mount(start());
  607. _GM_registerMenuCommand(`${initObj().onlyUrls ? "仅在收藏题单页面生效" : "所有题单生效"}`, () => {
  608. const u = initObj();
  609. u.onlyUrls = !u.onlyUrls;
  610. Container.style.display = support_plugins() ? "block" : "none";
  611. _GM_setValue(__0x3f_problmes_solution__, u);
  612. });
  613. _GM_registerMenuCommand(`添加本页`, () => {
  614. const urls = initUrls();
  615. let ok = false;
  616. const url = window.location.href;
  617. for (let info of urls) {
  618. if (!info || !(info == null ? void 0 : info.link)) {
  619. continue;
  620. }
  621. if (info.link.indexOf(url) != -1) {
  622. ok = true;
  623. break;
  624. }
  625. }
  626. if (ok) {
  627. ElementPlus.ElMessage({
  628. message: "收藏失败,链接已经存在!",
  629. type: "error"
  630. });
  631. } else {
  632. urls.unshift({
  633. title: document.title,
  634. link: url
  635. });
  636. Container.style.display = "block";
  637. _GM_setValue(__0x3f_problmes_urls__, urls);
  638. _GM_setValue(__add_cur__, true);
  639. ElementPlus.ElMessage({
  640. message: "收藏成功!刷新生效",
  641. type: "success"
  642. });
  643. }
  644. });
  645.  
  646. })(Vue, ElementPlus);