From 472879f9b23ead44b435c0660b28c0d8a7d1d4a1 Mon Sep 17 00:00:00 2001 From: Dian Qi Date: Sun, 4 Jun 2023 20:30:03 +0800 Subject: [PATCH 01/21] Fix format regex error that will match all inputs --- src/renderer/plugins-manager/options.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/plugins-manager/options.ts b/src/renderer/plugins-manager/options.ts index aeb361dc..535d4ff8 100644 --- a/src/renderer/plugins-manager/options.ts +++ b/src/renderer/plugins-manager/options.ts @@ -6,7 +6,7 @@ import useFocus from './clipboardWatch'; function formatReg(regStr) { const flags = regStr.replace(/.*\/([gimy]*)$/, '$1'); - const pattern = flags.replace(new RegExp('^/(.*?)/' + flags + '$'), '$1'); + const pattern = regStr.replace(new RegExp('^/(.*?)/' + flags + '$'), '$1'); return new RegExp(pattern, flags); } From f1f4e62177e611143df2de8795ef5bb923485a43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=A8=E5=81=B6?= <2424880409@qq.com> Date: Tue, 28 May 2024 20:12:38 +0800 Subject: [PATCH 02/21] fix: #352 --- src/main/browsers/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/browsers/main.ts b/src/main/browsers/main.ts index 35b94db8..702bff23 100644 --- a/src/main/browsers/main.ts +++ b/src/main/browsers/main.ts @@ -25,7 +25,7 @@ export default () => { height: WINDOW_HEIGHT, minHeight: WINDOW_MIN_HEIGHT, useContentSize: true, - resizable: true, + resizable: false, width: WINDOW_WIDTH, frame: false, title: '拉比克', From c3bc0bdb9e4bc0db9fa39078c02ca652f41bff62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=A8=E5=81=B6?= <2424880409@qq.com> Date: Tue, 28 May 2024 20:13:10 +0800 Subject: [PATCH 03/21] fix: #352 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d7af4eb2..a67ea7d1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rubick", - "version": "4.2.3", + "version": "4.2.4", "author": "muwoo <2424880409@qq.com>", "private": true, "scripts": { From 2053491782949b7b904dcfe974126e3a37bf4007 Mon Sep 17 00:00:00 2001 From: muwoo <2424880409@qq.com> Date: Fri, 14 Jun 2024 19:49:24 +0800 Subject: [PATCH 04/21] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 6767e387..23a03d06 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,8 @@ Those who are interested in this project or want to exchange and learn can scan ![image](https://user-images.githubusercontent.com/21073039/127327603-9796f246-ee4b-4950-a69d-ce3205ec9569.png) +Featured|HelloGitHub + ## Contribute This project exists thanks to all the people who contribute. [[Contribute](https://github.com/rubickCenter/rubick/graphs/contributors)]. From 6b9d5182bf90e9c7d3a8b8b47feb2f72e1a43966 Mon Sep 17 00:00:00 2001 From: layyback <505187749@qq.com> Date: Thu, 18 Jul 2024 16:46:33 +0800 Subject: [PATCH 05/21] :bug: fix hooks triggering issue --- src/main/browsers/runner.ts | 28 ++++++++++++++-------------- src/main/common/api.ts | 6 ++++-- src/renderer/App.vue | 13 +++++++------ 3 files changed, 25 insertions(+), 22 deletions(-) diff --git a/src/main/browsers/runner.ts b/src/main/browsers/runner.ts index d63b7881..3c58e469 100644 --- a/src/main/browsers/runner.ts +++ b/src/main/browsers/runner.ts @@ -72,6 +72,8 @@ export default () => { view.setAutoResize({ width: true, height: true }); executeHooks('PluginEnter', ext); executeHooks('PluginReady', ext); + console.log('enterrrr'); + const config = await localConfig.getConfig(); const darkMode = config.perf.common.darkMode; darkMode && @@ -175,31 +177,29 @@ export default () => { const removeView = (window: BrowserWindow) => { if (!view) return; - window.removeBrowserView(view); - if (!view.inDetach) { - window.setBrowserView(null); - view.webContents?.destroy(); - } - - // window.setSize(800, 60); executeHooks('PluginOut', null); - window.webContents?.executeJavaScript(`window.initRubick()`); - view = undefined; + setTimeout(() => { + window.removeBrowserView(view); + if (!view.inDetach) { + window.setBrowserView(null); + view.webContents?.destroy(); + } + window.webContents?.executeJavaScript(`window.initRubick()`); + view = undefined; + }, 0); }; const getView = () => view; const executeHooks = (hook, data) => { - setTimeout(() => { - if (!view) return; - const evalJs = `if(window.rubick && window.rubick.hooks && typeof window.rubick.hooks.on${hook} === 'function' ) { + if (!view) return; + const evalJs = `if(window.rubick && window.rubick.hooks && typeof window.rubick.hooks.on${hook} === 'function' ) { try { window.rubick.hooks.on${hook}(${data ? JSON.stringify(data) : ''}); } catch(e) {} } `; - view.webContents?.executeJavaScript(evalJs); - }, 300); + view.webContents?.executeJavaScript(evalJs); }; return { diff --git a/src/main/common/api.ts b/src/main/common/api.ts index e08f9f34..61c43c56 100644 --- a/src/main/common/api.ts +++ b/src/main/common/api.ts @@ -91,7 +91,7 @@ class API extends DBInstance { }).show(); } window.setSize(window.getSize()[0], 60); - this.removePlugin(null, window); + // this.removePlugin(null, window); // 模板文件 if (!plugin.main) { plugin.tplPath = common.dev() @@ -128,8 +128,10 @@ class API extends DBInstance { } public removePlugin(e, window) { - this.currentPlugin = null; runnerInstance.removeView(window); + setTimeout(() => { + this.currentPlugin = null; + }, 100); } public openPluginDevTools() { diff --git a/src/renderer/App.vue b/src/renderer/App.vue index dbdfe735..c62da667 100644 --- a/src/renderer/App.vue +++ b/src/renderer/App.vue @@ -1,8 +1,5 @@