diff --git a/electron/mapi/manager/plugin/index.ts b/electron/mapi/manager/plugin/index.ts index 973abc2..e431265 100644 --- a/electron/mapi/manager/plugin/index.ts +++ b/electron/mapi/manager/plugin/index.ts @@ -53,6 +53,9 @@ export const ManagerPlugin = { preloadBase = preloadDefault } } + if (preloadBase && !rendererIsUrl(preloadBase)) { + preloadBase = `file://${preloadBase}` + } // preload let preload = plugin.preload || null; if (preload) { @@ -87,6 +90,9 @@ export const ManagerPlugin = { mainFastPanel = mainFastPanel.replace('/', '') mainFastPanel = rendererDistPath(mainFastPanel) } + if (!rendererIsUrl(mainFastPanel)) { + mainFastPanel = `file://${mainFastPanel}` + } // auto detach let autoDetach = false diff --git a/electron/mapi/manager/window/index.ts b/electron/mapi/manager/window/index.ts index 80c67cb..5ca9e5d 100644 --- a/electron/mapi/manager/window/index.ts +++ b/electron/mapi/manager/window/index.ts @@ -96,11 +96,7 @@ export const ManagerWindow = { view._window = AppRuntime.mainWindow remoteMain.enable(view.webContents) AppRuntime.mainWindow.addBrowserView(view); - if (rendererIsUrl(main)) { - view.webContents.loadURL(main).then() - } else { - view.webContents.loadFile(main).then() - } + view.webContents.loadURL(main).then() DevToolsManager.register(`MainCodeView.${plugin.name}`, view) view.webContents.on('preload-error', (event, preloadPath, error) => { Log.error('ManagerWindow.openForCode.preload-error', error) @@ -260,7 +256,7 @@ export const ManagerWindow = { } }); view.webContents.on('preload-error', (event, preloadPath, error) => { - console.error('MainView.preload-error', error) + Log.error('ManagerWindow.open.preload-error', error) }) view.webContents.setWindowOpenHandler(({url}) => { if (url.startsWith('https://') || url.startsWith('http://')) { diff --git a/src/pages/FastPanel/FastPanelResult.vue b/src/pages/FastPanel/FastPanelResult.vue index 105f9d9..032b0bc 100644 --- a/src/pages/FastPanel/FastPanelResult.vue +++ b/src/pages/FastPanel/FastPanelResult.vue @@ -78,10 +78,10 @@ const queryWeb = () => { }) aa['_web'].addEventListener('dom-ready', async () => { await executePluginHooks(a['_web'], 'PluginReady', readyData) - aa['_web'].openDevTools({ - mode: 'detach', - activate: false, - }) + // aa['_web'].openDevTools({ + // mode: 'detach', + // activate: false, + // }) }) aa['_web'].addEventListener('ipc-message', (event) => { if ('FocusAny.FastPanel' === event.channel) {