// ==UserScript== // @name Vue开发路由跳转辅助工具《vue-router-tool》 // @namespace npm/vue-router-tool // @version 0.0.5 // @author shixiaoshi // @description 对于Vue项目的开发,多路由之间的切换是浪费时间且麻烦的,使用本插件,可以让您在路由之间顺畅切换。智能的路径补全,可以更快打开您开发的项目。 // @license MIT // @icon https://vitejs.dev/logo.svg // @match https://*/* // @match http://*/* // @require https://cdn.jsdelivr.net/npm/vue@3.2.45/dist/vue.global.prod.js // @grant GM_deleteValue // @grant GM_getValue // @grant GM_listValues // @grant GM_registerMenuCommand // @grant GM_setValue // @run-at document-end // @noframes // @downloadURL none // ==/UserScript== (t=>{const e=document.createElement("style");e.dataset.source="vite-plugin-monkey",e.innerText=t,document.head.appendChild(e)})('.monkey-box-wrap[data-v-65abfbd2]{position:fixed;z-index:9999;background:rgba(255,255,255,.9);box-shadow:0 4px 8px #07111b33;border-radius:8px}.monkey-box-wrap[data-v-65abfbd2]:before{content:"";display:block;width:8px;height:8px;background:#fff;z-index:1900;position:absolute;transform:rotate(45deg);left:20px}.belowPart[data-v-65abfbd2]:before{bottom:-4px}.upPart[data-v-65abfbd2]:before{top:-4px}.message-enter-from[data-v-65abfbd2]{min-height:0px;opacity:0}.message-enter-active[data-v-65abfbd2],.message-leave-active[data-v-65abfbd2]{transition:all .2s ease-out}.message-leave-to[data-v-65abfbd2]{min-height:0;opacity:0}.monkey-router-wrap[data-v-ae3d00f3]{width:100%;padding:10px;max-height:300px;min-height:20px;overflow-y:auto;overflow-x:hidden;cursor:pointer}.monkey-router-wrap .monkey-router-item[data-v-ae3d00f3]{margin-bottom:10px;border-radius:3px;padding:4px;align-items:center;justify-content:space-between;display:flex;transition:all .1s linear}.monkey-router-wrap .monkey-router-item .monkey-left[data-v-ae3d00f3]{width:30px;height:30px;border-radius:5px;background:#fff;display:flex;justify-content:center;align-items:center;padding:2px;overflow:hidden;transition:padding .1s linear}.monkey-router-wrap .monkey-router-item .monkey-left[data-v-ae3d00f3]:hover{padding:5px;transition:padding .1s linear}.monkey-router-wrap .monkey-router-item .monkey-middle[data-v-ae3d00f3]{flex:1;margin:0 5px 0 10px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.monkey-router-wrap .monkey-router-item .monkey-middle .monkey-path-wrap[data-v-ae3d00f3]{height:20px;display:block;font-size:14px;color:#303133;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.monkey-router-wrap .monkey-router-item .monkey-middle .monkey-name-wrap[data-v-ae3d00f3]{font-size:12px;color:#909399}.monkey-router-wrap .monkey-router-item .monkey-right[data-v-ae3d00f3]{width:15px;display:flex;justify-content:space-between;align-items:center;overflow:hidden}.monkey-router-wrap .monkey-router-item .monkey-right div[data-v-ae3d00f3]{display:flex;justify-content:center;align-items:center;width:15px;height:15px}.monkey-router-wrap .monkey-router-item[data-v-ae3d00f3]:hover{transform:translate(3px);background:#EBEDF0;box-shadow:0 4px 8px #07111b1a}.monkey-setting-wrap[data-v-322975a3]{max-height:400px;overflow-y:auto;font-size:12px;overflow-x:hidden;padding:5px;color:#606266}.monkey-setting-wrap .monkey-setting-item[data-v-322975a3]{padding:5px;border-radius:5px;transition:all .1s linear;margin-bottom:5px}.monkey-setting-wrap .monkey-setting-item[data-v-322975a3]:hover{transform:translate(3px);background:#F5F7FA;color:#909399;box-shadow:0 4px 8px #07111b1a}.monkey-setting-wrap .monkey-setting-item .monkey-input-wrap[data-v-322975a3]{overflow:hidden;display:flex}.monkey-setting-wrap .monkey-setting-item .monkey-input-wrap .monkey-input[data-v-322975a3]{appearance:none;height:25px;border-radius:4px;border:1px solid #c8cccf;color:#6a6f77;outline:0;text-align:left;padding:0 5px;width:100%;flex:1;font-size:12px}.monkey-setting-wrap .monkey-setting-item .monkey-input-wrap .monkey-input[data-v-322975a3]:focus{border:1px solid #3aa7e5}.monkey-setting-wrap .monkey-setting-item .monkey-tip-wrap[data-v-322975a3]{flex:1;display:flex;margin-bottom:5px;align-items:center;height:100%}.monkey-setting-wrap .monkey-setting-item .monkey-tip-wrap .monkey-name[data-v-322975a3]{display:flex;margin-right:5px}.monkey-setting-wrap .monkey-setting-item .monkey-tip-wrap .monkey-name span[data-v-322975a3]{margin-right:5px}.monkey-setting-wrap .monkey-setting-item .monkey-tip-wrap .monkey-icon[data-v-322975a3]{display:flex;width:14px;height:14px;justify-content:center;align-items:center;overflow:hidden}.monkey-setting-wrap .monkey-setting-item .monkey-tip-wrap .monkey-ensure[data-v-322975a3]{cursor:pointer;height:20px;padding:0 9px;border-radius:4px;box-sizing:border-box;display:inline-flex;justify-content:center;align-items:center;border-color:var(--el-tag-border-color);color:#409eff;background:#ecf5ff;border:1px solid #d9ecff}.monkey-setting-wrap .monkey-setting-item .monkey-item-wrap[data-v-322975a3]{height:20px;display:flex;cursor:pointer;align-items:center;justify-content:space-between}.monkey-setting-wrap .monkey-setting-item .monkey-item-wrap .monkey-left[data-v-322975a3]{display:flex}.monkey-setting-wrap .monkey-setting-item .monkey-item-wrap .monkey-right[data-v-322975a3]{width:36px;height:18px;background:#dcdfe6;border-radius:10px;display:flex;align-items:center;justify-content:flex-start;padding:0 2px;box-sizing:border-box}.monkey-setting-wrap .monkey-setting-item .monkey-item-wrap .monkey-right span[data-v-322975a3]{height:14px;width:14px;background:#fff;display:block;border-radius:50%}.monkey-setting-wrap .monkey-setting-item .monkey-item-wrap .select[data-v-322975a3]{justify-content:flex-end;background:#409eff;transition:all .2s linear}.monkey-setting-wrap .monkey-setting-item .monkey-checkbox-wrap span[data-v-322975a3]{display:flex;padding-left:15px;height:20px;align-items:center;color:#a8abb2}.monkey-setting-wrap .monkey-setting-item .monkey-checkbox-wrap span input[data-v-322975a3]{margin-right:5px}.monkey-wrap[data-v-c7b0cc58]{position:fixed;cursor:pointer;z-index:9999;user-select:none;background:rgba(255,255,255,.5);backdrop-filter:blur(10px);box-shadow:0 4px 8px #07111b1a;border-radius:8px;display:flex;padding:5px 10px;height:40px;right:auto;min-width:175px}.monkey-wrap .v-drag-handle[data-v-c7b0cc58]{cursor:move}.monkey-wrap .icon[data-v-c7b0cc58]{width:20px;height:20px;display:inline-block;display:flex;justify-content:center;align-items:center;overflow:hidden;margin-left:10px}.monkey-wrap .monkey-home-wrap[data-v-c7b0cc58]{overflow:hidden;display:flex;align-items:center;background:#E9F7FD;border-radius:15px;color:#3aa7e5}.monkey-wrap .monkey-home-wrap .monkey-name-wrap[data-v-c7b0cc58]{display:flex;width:100%;align-items:center}.monkey-wrap .monkey-home-wrap .monkey-name-wrap .monkey-arrow[data-v-c7b0cc58]{width:12px;height:12px;display:flex;justify-content:center;align-items:center;transform:rotate(180deg);margin-right:10px;transition:transform .3s}.monkey-wrap .monkey-home-wrap .monkey-name-wrap .monkey-arrow img[data-v-c7b0cc58]{width:100%;height:auto}.monkey-wrap .monkey-home-wrap .monkey-name-wrap .monkey-name[data-v-c7b0cc58]{text-align:center;display:inline-block;margin:0 10px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.monkey-wrap .monkey-home-wrap .monkey-name-wrap:hover .monkey-arrow[data-v-c7b0cc58]{transform:rotate(0);transition:transform .3s}.monkey-wrap .monkey-menu-wrap[data-v-c7b0cc58]{display:flex;align-items:center}'); (function(vue$1) { "use strict"; const style = ""; const _imports_0 = "data:image/svg+xml;base64,PHN2ZyB0PSIxNjY5Mjc4NjExMTMxIiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjE0OTI3IiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCI+PHBhdGggZD0iTTEwMDUuOSA2OTFjMTEuMiAxMS4yIDE2LjcgMjUuOCAxNi43IDQwLjUgMCAxNC42LTUuNSAyOS4zLTE2LjcgNDAuNS0yMi4zIDIyLjMtNTguNSAyMi4zLTgwLjggMEw1MTEuNCAzNTguMSA5Ny42IDc3MS43Yy0yMi4zIDIyLjMtNTguNSAyMi4zLTgwLjggMC0yMi4zLTIyLjMtMjIuMy01OC41IDAtODAuOEw0NDYuNyAyNjFjMTcuMy0xNy4zIDQwLjItMjYuNyA2NC43LTI2LjdzNDcuNCA5LjUgNjQuNyAyNi43bDQyOS44IDQzMHogbTAgMCIgZmlsbD0iICMzQUE3RTUiIHAtaWQ9IjE0OTI4Ij48L3BhdGg+PC9zdmc+"; const _sfc_main$3 = /* @__PURE__ */ vue$1.defineComponent({ __name: "index", props: ["top", "left", "width", "bottom", "upperPart"], setup(__props) { const props = __props; vue$1.onMounted(() => { visible.value = true; boxWrap.value.addEventListener("click", (e) => { e.stopPropagation(); }); }); const boxWrap = vue$1.ref(); const styles = vue$1.computed( () => { return { left: props.left, width: props.width, bottom: props.upperPart ? "" : props.bottom, top: props.upperPart ? props.top : "" }; } ); const customClass = vue$1.computed(() => { return props.upperPart ? "upPart" : "belowPart"; }); let visible = vue$1.ref(false); return (_ctx, _cache) => { return vue$1.openBlock(), vue$1.createBlock(vue$1.Transition, { name: "message", onAfterLeave: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("destroy")) }, { default: vue$1.withCtx(() => [ vue$1.withDirectives(vue$1.createElementVNode("div", { class: vue$1.normalizeClass(["monkey-box-wrap", vue$1.unref(customClass)]), style: vue$1.normalizeStyle(vue$1.unref(styles)), ref_key: "boxWrap", ref: boxWrap }, [ vue$1.renderSlot(_ctx.$slots, "default", {}, void 0, true) ], 6), [ [vue$1.vShow, vue$1.unref(visible)] ]) ]), _: 3 }); }; } }); const index_vue_vue_type_style_index_0_scoped_65abfbd2_lang = ""; const _export_sfc = (sfc, props) => { const target = sfc.__vccOpts || sfc; for (const [key, val] of props) { target[key] = val; } return target; }; const boxWrapComponent = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-65abfbd2"]]); var monkeyWindow = window; var GM_setValue = /* @__PURE__ */ (() => monkeyWindow.GM_setValue)(); var GM_deleteValue = /* @__PURE__ */ (() => monkeyWindow.GM_deleteValue)(); var GM_listValues = /* @__PURE__ */ (() => monkeyWindow.GM_listValues)(); var GM_registerMenuCommand = /* @__PURE__ */ (() => monkeyWindow.GM_registerMenuCommand)(); var GM_getValue = /* @__PURE__ */ (() => monkeyWindow.GM_getValue)(); const GM_setObject = function(name, value) { GM_setValue(name, JSON.stringify(value)); }; const GM_getObject = function(name, defaultValue) { let value = GM_getValue(name, "") || ""; try { return JSON.parse(value); } catch (e) { return defaultValue; } }; let vm; const bodyHight = document.documentElement.clientHeight; const container = document.createElement("div"); const createBoxWarp = (dragBox, component) => { if (!component) { return vue$1.render(null, container); } const boxTop = GM_getObject("BOX_TOP", dragBox.offsetTop); const boxLeft = GM_getObject("BOX_LEFT", dragBox.offsetLeft); const centerLinePosition = boxTop + dragBox.clientHeight / 2; const upperPart = bodyHight / 2 - centerLinePosition > 0 ? true : false; const left = boxLeft + "px"; const width = dragBox.offsetWidth + "px"; if (vm) { vue$1.render(null, container); } const props = { upperPart, top: boxTop + dragBox.offsetHeight + 10 + "px", bottom: bodyHight - boxTop + 10 + "px", width, left, onDestroy: () => { vue$1.render(null, container); } }; vm = vue$1.createVNode(boxWrapComponent, props, () => vue$1.h(component)); vue$1.render(vm, container); document.body.appendChild(container.firstElementChild); //!表示一定有 }; const home = ''; const refresh = ''; const setting = ''; const vue = ''; const vueGray = ''; function getJumpUrl(url) { const queryInfo = GM_getObject("SEARCH_VALUE", ""); let jumpUrl = url; if (queryInfo) { jumpUrl += `?${queryInfo}`; } return jumpUrl; } const getRouterInfo = () => { var _a, _b, _c, _d, _e, _f, _g, _h; const urlInfo = GM_getObject("URL_INFO", ""); const vueApp = document.body.querySelector("div"); (_a = vueApp == null ? void 0 : vueApp.__vue__) == null ? void 0 : _a.$route; const baseUrl = (_e = (_d = (_c = (_b = vueApp == null ? void 0 : vueApp.__vue__) == null ? void 0 : _b.$router) == null ? void 0 : _c.options) == null ? void 0 : _d.base) != null ? _e : ""; let $router = (_h = (_g = (_f = vueApp == null ? void 0 : vueApp.__vue__) == null ? void 0 : _f.$router) == null ? void 0 : _g.options) == null ? void 0 : _h.routes; if (($router == null ? void 0 : $router.length) > 0) { $router = $router.filter((res) => !res.path.includes(":")); } const router = $router.map((res) => { var _a2, _b2, _c2, _d2, _e2; const url = (location.host + baseUrl + (res == null ? void 0 : res.path)).replace(/\/\//, "/"); const pathName = (baseUrl + (res == null ? void 0 : res.path)).replace(/\/\//, "/"); return { path: res == null ? void 0 : res.path, name: (_e2 = (_d2 = (_c2 = (_a2 = res == null ? void 0 : res.meta) == null ? void 0 : _a2.title) != null ? _c2 : (_b2 = res == null ? void 0 : res.meta) == null ? void 0 : _b2.name) != null ? _d2 : res == null ? void 0 : res.name) != null ? _e2 : res == null ? void 0 : res.path, fulUrl: `${location.protocol}//${url}`, pathName, select: pathName === location.pathname }; }); const autoJump = GM_getObject("AUTO_JUMP", true); if (!location.href.includes("localhost")) return router; if (router.length === 0) return router; if (!autoJump) return router; if (!urlInfo.fulUrl) { GM_setObject("URL_INFO", router[0]); if (baseUrl !== location.pathname) return router; location.href = getJumpUrl(router[0].fulUrl); } else { if (router.some((res) => res.pathName === urlInfo.pathName)) { if (location.pathname === urlInfo.pathName) return router; let routerItem = router.find((res) => res.pathName === location.pathname); if (routerItem) { GM_setObject("URL_INFO", routerItem); return router; } location.href = getJumpUrl(urlInfo.fulUrl); return router; } else { GM_setObject("URL_INFO", router[0]); if (location.href.includes(router[0].fulUrl)) return router; location.href = getJumpUrl(router[0].fulUrl); return router; } } return router; }; const _hoisted_1$2 = { class: "monkey-router-wrap" }; const _hoisted_2$2 = ["innerHTML"]; const _hoisted_3$2 = ["innerHTML"]; const _hoisted_4$2 = ["onClick"]; const _hoisted_5$2 = { class: "monkey-path-wrap" }; const _hoisted_6$2 = { class: "monkey-name-wrap" }; const _sfc_main$2 = /* @__PURE__ */ vue$1.defineComponent({ __name: "router", setup(__props) { const vTitle = { mounted(el) { el.onmouseenter = (e) => { const { clientWidth, scrollWidth, title } = el; if (!title && scrollWidth > clientWidth) el.title = el.innerText; }; } }; const routers = getRouterInfo(); const jump = (urlInfo) => { if (location.href.includes("localhost")) { GM_setObject("URL_INFO", urlInfo); } const queryInfo = GM_getObject("SEARCH_VALUE", ""); let jumpUrl = urlInfo.fulUrl; if (queryInfo && location.href.includes("localhost")) { jumpUrl += `?${queryInfo}`; } location.href = jumpUrl; }; return (_ctx, _cache) => { return vue$1.openBlock(), vue$1.createElementBlock("div", _hoisted_1$2, [ (vue$1.openBlock(true), vue$1.createElementBlock(vue$1.Fragment, null, vue$1.renderList(vue$1.unref(routers), (item, index) => { return vue$1.openBlock(), vue$1.createElementBlock("div", { class: "monkey-router-item", key: index }, [ vue$1.withDirectives(vue$1.createElementVNode("div", { class: "monkey-left", innerHTML: vue$1.unref(vueGray) }, null, 8, _hoisted_2$2), [ [vue$1.vShow, !item.select] ]), vue$1.withDirectives(vue$1.createElementVNode("div", { class: "monkey-left", innerHTML: vue$1.unref(vue) }, null, 8, _hoisted_3$2), [ [vue$1.vShow, item.select] ]), vue$1.createElementVNode("div", { class: "monkey-middle", onClick: ($event) => jump(item) }, [ vue$1.withDirectives((vue$1.openBlock(), vue$1.createElementBlock("div", _hoisted_5$2, [ vue$1.createTextVNode(vue$1.toDisplayString(item.path), 1) ])), [ [vTitle] ]), vue$1.withDirectives((vue$1.openBlock(), vue$1.createElementBlock("div", _hoisted_6$2, [ vue$1.createTextVNode(vue$1.toDisplayString(item.name), 1) ])), [ [vTitle] ]) ], 8, _hoisted_4$2) ]); }), 128)) ]); }; } }); const router_vue_vue_type_style_index_0_scoped_ae3d00f3_lang = ""; const routerComponent = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-ae3d00f3"]]); const help = ''; const _withScopeId$1 = (n) => (vue$1.pushScopeId("data-v-322975a3"), n = n(), vue$1.popScopeId(), n); const _hoisted_1$1 = { class: "monkey-setting-wrap" }; const _hoisted_2$1 = { class: "monkey-setting-item" }; const _hoisted_3$1 = { class: "monkey-tip-wrap" }; const _hoisted_4$1 = { class: "monkey-name" }; const _hoisted_5$1 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ vue$1.createElementVNode("span", null, "\u8DEF\u7531search\u53C2\u6570", -1)); const _hoisted_6$1 = ["innerHTML"]; const _hoisted_7$1 = { class: "monkey-input-wrap" }; const _hoisted_8 = { class: "monkey-setting-item" }; const _hoisted_9 = { class: "monkey-tip-wrap monkey-item-wrap" }; const _hoisted_10 = { class: "monkey-left" }; const _hoisted_11 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ vue$1.createElementVNode("span", { class: "monkey-name" }, "\u4EC5\u5F00\u53D1\u6A21\u5F0F\u663E\u793A", -1)); const _hoisted_12 = ["innerHTML"]; const _hoisted_13 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ vue$1.createElementVNode("span", null, null, -1)); const _hoisted_14 = [ _hoisted_13 ]; const _hoisted_15 = { class: "monkey-setting-item" }; const _hoisted_16 = { class: "monkey-tip-wrap monkey-item-wrap" }; const _hoisted_17 = { class: "monkey-left" }; const _hoisted_18 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ vue$1.createElementVNode("span", { class: "monkey-name" }, "\u8DEF\u7531\u667A\u80FD\u8865\u5168", -1)); const _hoisted_19 = ["innerHTML"]; const _hoisted_20 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ vue$1.createElementVNode("span", null, null, -1)); const _hoisted_21 = [ _hoisted_20 ]; const _hoisted_22 = { class: "monkey-setting-item" }; const _hoisted_23 = { class: "monkey-tip-wrap" }; const _hoisted_24 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ vue$1.createElementVNode("span", { class: "monkey-name" }, "\u70B9\u51FB\u5237\u65B0\u6309\u94AE", -1)); const _hoisted_25 = ["innerHTML"]; const _hoisted_26 = { class: "monkey-checkbox-wrap" }; const _hoisted_27 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ vue$1.createElementVNode("label", { for: "localStorage" }, "\u6E05\u9664localStorage", -1)); const _hoisted_28 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ vue$1.createElementVNode("label", { for: "sessionStorage" }, "\u6E05\u9664sessionStorage", -1)); const _hoisted_29 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ vue$1.createElementVNode("label", { for: "cookie" }, "\u6E05\u9664cookie", -1)); const _sfc_main$1 = /* @__PURE__ */ vue$1.defineComponent({ __name: "setting", setup(__props) { vue$1.onMounted(() => { document.addEventListener("keydown", (e) => { const code = e.keyCode; if (code == 13) { save(); } }); }); const vTip = { mounted(el, binding) { el.onmouseenter = (e) => { el.title = binding.value; }; } }; const tip2 = vue$1.ref("\u8BBE\u7F6Eurl\u94FE\u63A5\u201C?\u201D\u540E\u7684\u5185\u5BB9\uFF1A\u5728\u5F00\u53D1\u6A21\u5F0F\u4E0B\uFF0C\u6B64\u503C\u5C06\u6DFB\u52A0\u5728\u6240\u6709url\u540E\u9762\u3002"); const jumpTip = vue$1.ref("\u5F00\u542F\u6B64\u529F\u80FD\u540E\uFF0C\u5F53\u60A8\u8F93\u5165\u4E0D\u5B8C\u6574\u8DEF\u7531\u65F6\uFF0C\u811A\u672C\u4F1A\u81EA\u52A8\u8865\u5168"); const refreshTip = vue$1.ref("\u5237\u65B0\u65F6\u7684\u989D\u5916\u9009\u9879"); let select = vue$1.ref(); select.value = GM_getObject("AUTO_JUMP", true); const devStatus = vue$1.ref(GM_getObject("DEV", true)); const autoJump = () => { select.value = !select.value; GM_setObject("AUTO_JUMP", select.value); }; const dev2 = () => { devStatus.value = !devStatus.value; GM_setObject("DEV", devStatus.value); }; let inputValue = vue$1.ref(""); inputValue.value = GM_getObject("SEARCH_VALUE", ""); let ensureButton = vue$1.ref(false); let localStorage2 = vue$1.ref(GM_getObject("CLEAR_LStORAGE", false)); let sessionStorage2 = vue$1.ref(GM_getObject("CLEAR_SStORAGE", false)); let cookie = vue$1.ref(GM_getObject("CLEAR_COOKIE", false)); vue$1.watch(inputValue, (v) => { if (v.trim() !== GM_getObject("SEARCH_VALUE", "")) { ensureButton.value = true; } else { ensureButton.value = false; } }); vue$1.watch(inputValue, (v) => { if (v.trim() !== GM_getObject("SEARCH_VALUE", "")) { ensureButton.value = true; } else { ensureButton.value = false; } }); vue$1.watch(localStorage2, (v) => { GM_setObject("CLEAR_LStORAGE", v); }); vue$1.watch(sessionStorage2, (v) => { GM_setObject("CLEAR_SStORAGE", v); }); vue$1.watch(cookie, (v) => { GM_setObject("CLEAR_COOKIE", v); }); const save = () => { if (!ensureButton.value) return; GM_setObject("SEARCH_VALUE", inputValue.value.trim()); ensureButton.value = false; let jumpUrl = location.protocol + "//" + location.host + location.pathname; const queryInfo = inputValue.value.trim(); if (queryInfo) { jumpUrl += `?${queryInfo}`; } location.href = jumpUrl; }; return (_ctx, _cache) => { return vue$1.openBlock(), vue$1.createElementBlock("div", _hoisted_1$1, [ vue$1.createElementVNode("div", _hoisted_2$1, [ vue$1.createElementVNode("div", _hoisted_3$1, [ vue$1.createElementVNode("div", _hoisted_4$1, [ _hoisted_5$1, vue$1.withDirectives(vue$1.createElementVNode("span", { class: "monkey-icon", innerHTML: vue$1.unref(help) }, null, 8, _hoisted_6$1), [ [vTip, tip2.value] ]) ]), vue$1.withDirectives(vue$1.createElementVNode("div", { class: "monkey-ensure", onClick: save }, "\u4FDD\u5B58", 512), [ [vue$1.vShow, vue$1.unref(ensureButton)] ]) ]), vue$1.createElementVNode("div", _hoisted_7$1, [ vue$1.withDirectives(vue$1.createElementVNode("input", { type: "monkey-text", class: "monkey-input", "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue$1.isRef(inputValue) ? inputValue.value = $event : inputValue = $event), placeholder: "\u8F93\u5165\u793A\u4F8B\uFF1AloginName=wyc" }, null, 512), [ [vue$1.vModelText, vue$1.unref(inputValue)] ]) ]) ]), vue$1.createElementVNode("div", _hoisted_8, [ vue$1.createElementVNode("div", _hoisted_9, [ vue$1.createElementVNode("div", _hoisted_10, [ _hoisted_11, vue$1.withDirectives(vue$1.createElementVNode("span", { class: "monkey-icon", innerHTML: vue$1.unref(help) }, null, 8, _hoisted_12), [ [vTip, "\u5F00\u542F\u6B64\u529F\u80FD\u540E\uFF0C\u4EC5\u5728localhost\u57DF\u540D\u4E0B\u663E\u793A\u6B64\u63D2\u4EF6\uFF0C\u5426\u5219\u6240\u6709vue\u9875\u9762\u90FD\u4F1A\u663E\u793A\u6B64\u63D2\u4EF6"] ]) ]), vue$1.createElementVNode("div", { class: vue$1.normalizeClass(["monkey-right", { select: devStatus.value }]), onClick: _cache[1] || (_cache[1] = ($event) => dev2()) }, _hoisted_14, 2) ]) ]), vue$1.createElementVNode("div", _hoisted_15, [ vue$1.createElementVNode("div", _hoisted_16, [ vue$1.createElementVNode("div", _hoisted_17, [ _hoisted_18, vue$1.withDirectives(vue$1.createElementVNode("span", { class: "monkey-icon", innerHTML: vue$1.unref(help) }, null, 8, _hoisted_19), [ [vTip, jumpTip.value] ]) ]), vue$1.createElementVNode("div", { class: vue$1.normalizeClass(["monkey-right", { select: vue$1.unref(select) }]), onClick: _cache[2] || (_cache[2] = ($event) => autoJump()) }, _hoisted_21, 2) ]) ]), vue$1.createElementVNode("div", _hoisted_22, [ vue$1.createElementVNode("div", _hoisted_23, [ _hoisted_24, vue$1.withDirectives(vue$1.createElementVNode("span", { class: "monkey-icon", innerHTML: vue$1.unref(help) }, null, 8, _hoisted_25), [ [vTip, refreshTip.value] ]) ]), vue$1.createElementVNode("div", _hoisted_26, [ vue$1.createElementVNode("span", null, [ vue$1.withDirectives(vue$1.createElementVNode("input", { type: "checkbox", id: "localStorage", "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => vue$1.isRef(localStorage2) ? localStorage2.value = $event : localStorage2 = $event) }, null, 512), [ [vue$1.vModelCheckbox, vue$1.unref(localStorage2)] ]), _hoisted_27 ]), vue$1.createElementVNode("span", null, [ vue$1.withDirectives(vue$1.createElementVNode("input", { type: "checkbox", id: "sessionStorage", "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => vue$1.isRef(sessionStorage2) ? sessionStorage2.value = $event : sessionStorage2 = $event) }, null, 512), [ [vue$1.vModelCheckbox, vue$1.unref(sessionStorage2)] ]), _hoisted_28 ]), vue$1.createElementVNode("span", null, [ vue$1.withDirectives(vue$1.createElementVNode("input", { type: "checkbox", id: "cookie", "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => vue$1.isRef(cookie) ? cookie.value = $event : cookie = $event) }, null, 512), [ [vue$1.vModelCheckbox, vue$1.unref(cookie)] ]), _hoisted_29 ]) ]) ]) ]); }; } }); const setting_vue_vue_type_style_index_0_scoped_322975a3_lang = ""; const settingCoComponent = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-322975a3"]]); const _withScopeId = (n) => (vue$1.pushScopeId("data-v-c7b0cc58"), n = n(), vue$1.popScopeId(), n); const _hoisted_1 = { class: "monkey-home-wrap" }; const _hoisted_2 = ["innerHTML"]; const _hoisted_3 = { class: "monkey-name" }; const _hoisted_4 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue$1.createElementVNode("span", { class: "monkey-arrow" }, [ /* @__PURE__ */ vue$1.createElementVNode("img", { src: _imports_0, alt: "" }) ], -1)); const _hoisted_5 = { class: "monkey-menu-wrap" }; const _hoisted_6 = ["innerHTML"]; const _hoisted_7 = ["innerHTML"]; const _sfc_main = /* @__PURE__ */ vue$1.defineComponent({ __name: "App", setup(__props) { let search = GM_getObject("SEARCH_VALUE", "").trim(); if (location.search && location.href.includes("localhost")) { let searchUrl = location.search.slice(1); if (!search || location.search !== search) { search = searchUrl; GM_setObject("SEARCH_VALUE", searchUrl); } } if (search && !location.search.includes(search) && location.href.includes("localhost")) { const routerList = getRouterInfo(); const routerItem = routerList.find((res) => res.select); if (routerItem) { location.href = `${routerItem.fulUrl}?${search}`; } } window.addEventListener("unload", () => { if (GM_getObject("REFRESH", true)) { if (GM_getObject("CLEAR_LStORAGE", false)) { localStorage.clear(); console.log("[vue-router-tool] localStorage\u5DF2\u7ECF\u6E05\u9664"); } if (GM_getObject("CLEAR_SStORAGE", false)) { sessionStorage.clear(); console.log("[vue-router-tool] sessionStorage\u5DF2\u7ECF\u6E05\u9664"); } if (GM_getObject("CLEAR_COOKIE", false)) { let keys = document.cookie.match(/[^ =;]+(?=\=)/g); if (keys) { for (var i = keys.length; i--; ) document.cookie = keys[i] + "=0;expires=" + new Date(0).toUTCString(); } console.log("[vue-router-tool] cookie\u5DF2\u7ECF\u6E05\u9664"); } } GM_setObject("REFRESH", false); }); const box = vue$1.ref(); const routerName = vue$1.computed(() => { const routerList = getRouterInfo(); let routerItem = routerList.find((res) => res.select); if (!routerItem) { return "---/---"; } else { return (routerItem == null ? void 0 : routerItem.name) ? routerItem.name : "---/---"; } }); const reLoad = () => { GM_setObject("REFRESH", true); location.href = location.href; }; let realWidth = vue$1.ref(); vue$1.onMounted(() => { realWidth.value = box.value.clientWidth; }); const position = vue$1.computed(() => { var _a, _b; const bodyWidth = (_b = (_a = document == null ? void 0 : document.body) == null ? void 0 : _a.clientWidth) != null ? _b : 0; const bodyHight2 = document.documentElement.clientHeight; let boxTop = GM_getObject("BOX_TOP", 20) + "px"; let boxLeft = GM_getObject("BOX_LEFT", 50) + "px"; if (realWidth.value && realWidth.value + GM_getObject("BOX_LEFT", 50) - bodyWidth > 0) { return { boxTop, boxLeft: bodyWidth - realWidth.value + "px" }; } if (GM_getObject("BOX_TOP", 20) < 0 || GM_getObject("BOX_TOP", 20) > bodyWidth || GM_getObject("BOX_TOP", 20) > bodyHight2 || GM_getObject("BOX_TOP", 20) < 0) { return { boxTop: "20px", boxLeft: "20px" }; } else { return { boxTop, boxLeft }; } }); document.addEventListener("click", () => { createBoxWarp(box.value, null); }); return (_ctx, _cache) => { const _directive_color = vue$1.resolveDirective("color"); const _directive_drag = vue$1.resolveDirective("drag"); return vue$1.withDirectives((vue$1.openBlock(), vue$1.createElementBlock("div", { class: "monkey-wrap", ref_key: "box", ref: box, style: vue$1.normalizeStyle({ top: vue$1.unref(position).boxTop, left: vue$1.unref(position).boxLeft }) }, [ vue$1.createElementVNode("div", _hoisted_1, [ vue$1.createElementVNode("span", { class: "icon v-drag-handle", innerHTML: vue$1.unref(home), onMouseenter: _cache[0] || (_cache[0] = ($event) => vue$1.unref(createBoxWarp)(box.value, null)) }, null, 40, _hoisted_2), vue$1.createElementVNode("div", { class: "monkey-name-wrap", onMouseenter: _cache[1] || (_cache[1] = ($event) => vue$1.unref(createBoxWarp)(box.value, routerComponent)) }, [ vue$1.createElementVNode("span", _hoisted_3, vue$1.toDisplayString(vue$1.unref(routerName)), 1), _hoisted_4 ], 32) ]), vue$1.createElementVNode("div", _hoisted_5, [ vue$1.withDirectives(vue$1.createElementVNode("span", { class: "icon", innerHTML: vue$1.unref(refresh), onClick: reLoad }, null, 8, _hoisted_6), [ [_directive_color] ]), vue$1.withDirectives(vue$1.createElementVNode("span", { class: "icon", innerHTML: vue$1.unref(setting), onMouseenter: _cache[2] || (_cache[2] = ($event) => vue$1.unref(createBoxWarp)(box.value, settingCoComponent)), onClick: _cache[3] || (_cache[3] = ($event) => vue$1.unref(createBoxWarp)(box.value, settingCoComponent)) }, null, 40, _hoisted_7), [ [_directive_color] ]) ]) ], 4)), [ [_directive_drag] ]); }; } }); const App_vue_vue_type_style_index_0_scoped_c7b0cc58_lang = ""; const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c7b0cc58"]]); const directive$1 = { beforeMount(el) { const dragBox = el; const dragArea = el.getElementsByClassName("v-drag-handle").length > 0 ? el.getElementsByClassName("v-drag-handle")[0] : el; const bodyWidth = document.body.clientWidth; const bodyHight2 = document.documentElement.clientHeight; dragArea.onmousedown = (e) => { let domLeft = dragBox.offsetLeft; let domTop = dragBox.offsetTop; e.preventDefault(); e.stopPropagation(); let mouseX = e.clientX - domLeft; let mouseY = e.clientY - domTop; const domWidth = dragBox.offsetWidth; const domHeight = dragBox.offsetHeight; document.onmousemove = (e2) => { let domCenterLeft = e2.clientX - mouseX; let domCenterTop = e2.clientY - mouseY; dragBox.style.left = domCenterLeft + "px"; dragBox.style.top = domCenterTop + "px"; domLeft = dragBox.offsetLeft; domTop = dragBox.offsetTop; let domRight = bodyWidth - domLeft - domWidth; let domBottom = bodyHight2 - domHeight - domTop; if (domRight <= 0) { dragBox.style.left = bodyWidth - domWidth + "px"; } if (domBottom < 0) { dragBox.style.top = bodyHight2 - domHeight + "px"; } if (domLeft < 0) { dragBox.style.left = 0; } if (domTop < 0) { dragBox.style.top = 0; } }; document.onmouseup = (e2) => { e2.preventDefault(); document.onmousemove = null; document.onmouseup = null; GM_setObject("BOX_LEFT", dragBox.offsetLeft); GM_setObject("BOX_TOP", dragBox.offsetTop); }; }; } }; const drag = { install: function(app) { app.directive("drag", directive$1); } }; const color = { beforeMount(el) { const wrapDom = el; const path = el.querySelector("path"); wrapDom.onmouseenter = function() { path.style.fill = "#3AA7E5"; }; wrapDom.onmouseleave = function() { path.style.fill = "#C7CBCF"; }; } }; const directives = { install: function(app) { app.directive("color", color); } }; const directive = { install: function(app) { app.use(drag); app.use(directives); } }; GM_registerMenuCommand("\u91CD\u7F6E\u811A\u672C", function() { const list = GM_listValues(); if (list.length > 0) list.forEach((res) => GM_deleteValue(res)); window.location.reload(); }); const dev = GM_getObject("DEV", true); let tip = dev ? "\u5728\u6240\u6709vue\u9875\u9762\u663E\u793A\u6B64\u63D2\u4EF6" : "\u4EC5\u5F00\u53D1\u6A21\u5F0F\u663E\u793A\u6B64\u63D2\u4EF6"; GM_registerMenuCommand(tip, function() { GM_setObject("DEV", !dev); window.location.reload(); }); window.addEventListener("load", () => { if (GM_getObject("DEV", true) && !location.hostname.includes("localhost")) return; const vueApp = document.body.querySelector("div"); if (vueApp == null ? void 0 : vueApp.__vue__) { vue$1.createApp(App).use(directive).mount( (() => { const app = document.createElement("div"); document.body.append(app); return app; })() ); } }); })(Vue);