Compare commits

...

12 Commits

Author SHA1 Message Date
muwoo
6bf613042a Update Vue CLI version in workflow 2025-11-20 21:48:34 +08:00
muwoo
04fe2e03a6 Pin Vue CLI version to 5.0.8 in workflow 2025-11-20 21:43:41 +08:00
muwoo
6c0d34fc4f Update package.json 2025-11-19 20:21:55 +08:00
muwoo
3fa9bb0384 Merge pull request #472 from 25juan/feature/volta
fix:修复当使用 volta 管理 node 版本的时候安装插件失败
2025-11-19 20:21:12 +08:00
muwoo
791115901a Merge pull request #473 from lanxiuyun/fix-detach
Fix: detach bug
2025-11-19 20:20:36 +08:00
lanxiuyun
a879ed6555 fix-detach 2025-11-11 13:56:52 +08:00
sgellar
28b58e7976 fix:修复当使用 volta 管理 node 版本的时候安装插件失败 2025-11-11 12:20:57 +08:00
muwoo
dc54b25f84 Merge pull request #464 from lanxiuyun/fix-feature-npm-i
fix: feature中的npm i
2025-09-16 10:21:04 +08:00
lanxiuyun
fc51a383bf 更新 less-loader 版本 2025-09-13 15:41:28 +08:00
muwoo
a546bc0d59 Update package.json 2025-07-25 18:40:09 +08:00
muwoo
c732e448c3 Merge pull request #449 from siriusol/master
fix #448
2025-07-25 18:39:43 +08:00
Ther
fbc7da0606 fix #448 2025-07-25 18:24:52 +08:00
6 changed files with 41 additions and 14 deletions

View File

@@ -52,7 +52,7 @@ jobs:
run: |
yarn
yarn global add xvfb-maybe
yarn global add @vue/cli
yarn global add @vue/cli@4.5.15
- name: Build feature
run: |
cd ./feature

View File

@@ -42,7 +42,7 @@
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-vue": "^7.0.0",
"less": "^4.1.3",
"less-loader": "5.0.0",
"less-loader": "^6.2.0",
"prettier": "^2.2.1",
"typescript": "~4.1.5"
},

View File

@@ -1,6 +1,6 @@
{
"name": "rubick",
"version": "4.3.4",
"version": "4.3.7",
"author": "muwoo <2424880409@qq.com>",
"private": true,
"scripts": {

View File

@@ -36,7 +36,14 @@ class AdapterHandler {
fs.mkdirsSync(options.baseDir);
fs.writeFileSync(
`${options.baseDir}/package.json`,
'{"dependencies":{}}'
// '{"dependencies":{}}'
// fix 插件安装时node版本问题
JSON.stringify({
dependencies: {},
volta: {
node: '16.19.1',
},
})
);
}
this.baseDir = options.baseDir;

View File

@@ -82,7 +82,7 @@ export default () => {
};
const init = (plugin, window: BrowserWindow) => {
if (view === null || view === undefined) {
if (view === null || view === undefined || view.inDetach) {
createView(plugin, window);
// if (viewInstance.getView(plugin.name) && !commonConst.dev()) {
// view = viewInstance.getView(plugin.name).view;
@@ -176,14 +176,29 @@ export default () => {
const removeView = (window: BrowserWindow) => {
if (!view) return;
executeHooks('PluginOut', null);
// 先记住这次要移除的视图,防止后面异步代码里全局引用被换掉
const snapshotView = view;
setTimeout(() => {
window.removeBrowserView(view);
if (!view.inDetach) {
window.setBrowserView(null);
view.webContents?.destroy();
// 获取当前视图,判断是否已经换成了新视图
const currentView = window.getBrowserView?.();
window.removeBrowserView(snapshotView);
// 主窗口的插件视图仍然挂着旧实例时,需要还原主窗口 UI
if (!snapshotView.inDetach) {
// 如果窗口还挂着旧视图,说明还没换掉,需要把主窗口恢复到初始状态
if (currentView === snapshotView) {
window.setBrowserView(null);
if (view === snapshotView) {
window.webContents?.executeJavaScript(`window.initRubick()`);
view = undefined;
}
}
snapshotView.webContents?.destroy();
}
// 分离窗口只需释放全局引用,视图由分离窗口继续管理
else if (view === snapshotView) {
view = undefined;
}
window.webContents?.executeJavaScript(`window.initRubick()`);
view = undefined;
}, 0);
};

View File

@@ -110,9 +110,14 @@ const registerHotKey = (mainWindow: BrowserWindow): void => {
// mainWindow.show();
});
globalShortcut.register('CommandOrControl+W', () => {
if (mainWindow && !mainWindow.isDestroyed() && mainWindow.isFocused()) {
mainWindow.hide();
// 添加局部快捷键监听
mainWindow.webContents.on('before-input-event', (event, input) => {
if (input.key.toLowerCase() === 'w'
&& (input.control || input.meta) && !input.alt && !input.shift) {
event.preventDefault();
if (mainWindow && !mainWindow.isDestroyed()) {
mainWindow.hide();
}
}
});