mirror of
https://github.com/rubickCenter/rubick
synced 2025-06-29 17:22:44 +08:00
♻️ 修改 onPluginEnter 执行时机.
This commit is contained in:
parent
7fb299d270
commit
2a1a332fbb
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "rubick",
|
"name": "rubick",
|
||||||
"version": "4.0.5",
|
"version": "4.0.6",
|
||||||
"author": "muwoo <2424880409@qq.com>",
|
"author": "muwoo <2424880409@qq.com>",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -175,14 +175,16 @@ export default () => {
|
|||||||
const getView = () => view;
|
const getView = () => view;
|
||||||
|
|
||||||
const executeHooks = (hook, data) => {
|
const executeHooks = (hook, data) => {
|
||||||
if (!view) return;
|
setTimeout(() => {
|
||||||
const evalJs = `if(window.rubick && window.rubick.hooks && typeof window.rubick.hooks.on${hook} === 'function' ) {
|
if (!view) return;
|
||||||
try {
|
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) : ''});
|
window.rubick.hooks.on${hook}(${data ? JSON.stringify(data) : ''});
|
||||||
} catch(e) {}
|
} catch(e) {}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
view.webContents?.executeJavaScript(evalJs);
|
view.webContents?.executeJavaScript(evalJs);
|
||||||
|
}, 300);
|
||||||
};
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user