mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-16 04:45:46 +00:00
feat: try support LiteLoader
This commit is contained in:
parent
bc7b4dcc2a
commit
8101d17482
@ -1 +1,2 @@
|
||||
VITE_BUILD_TYPE = Development
|
||||
VITE_BUILD_TYPE = Development
|
||||
VITE_BUILD_TARGE = Normal
|
2
.env.liteloader
Normal file
2
.env.liteloader
Normal file
@ -0,0 +1,2 @@
|
||||
VITE_BUILD_TYPE = Production
|
||||
VITE_BUILD_TARGE = Liteloader
|
@ -1 +1,2 @@
|
||||
VITE_BUILD_TYPE = Production
|
||||
VITE_BUILD_TARGE = Normal
|
2
src/core
2
src/core
@ -1 +1 @@
|
||||
Subproject commit 48c585b7e0d05f591b9ae45b84e805ca611fe313
|
||||
Subproject commit 8fe462777a9fa4fca1d67a8973be93b051960753
|
17
src/liteloader/main.ts
Normal file
17
src/liteloader/main.ts
Normal file
@ -0,0 +1,17 @@
|
||||
type BrowserWindow = any;
|
||||
function onBrowserWindowCreated(window: BrowserWindow) {
|
||||
|
||||
}
|
||||
async function loadNapCat() {
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
loadNapCat();
|
||||
} catch {
|
||||
console.log("loadNapCat error");
|
||||
}
|
||||
export {
|
||||
onBrowserWindowCreated
|
||||
};
|
||||
|
1
src/liteloader/preload.ts
Normal file
1
src/liteloader/preload.ts
Normal file
@ -0,0 +1 @@
|
||||
//暂且留空
|
18
src/liteloader/renderer.ts
Normal file
18
src/liteloader/renderer.ts
Normal file
@ -0,0 +1,18 @@
|
||||
async function onSettingWindowCreated(view: Element) {
|
||||
const iframe = document.createElement('iframe');
|
||||
iframe.src = 'http://127.0.0.1:6099/webui/'; //应该从 preload->main 那里获取
|
||||
iframe.style.cssText = 'position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;';
|
||||
view.appendChild(iframe);
|
||||
}
|
||||
async function isRendererInit() {
|
||||
|
||||
}
|
||||
|
||||
if (location.hash === '#/blank') {
|
||||
(window as any).navigation.addEventListener('navigatesuccess', isRendererInit, { once: true });
|
||||
} else {
|
||||
isRendererInit();
|
||||
}
|
||||
export {
|
||||
onSettingWindowCreated
|
||||
};
|
10
src/vite-env.d.ts
vendored
Normal file
10
src/vite-env.d.ts
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
/// <reference types="vite/client" />
|
||||
|
||||
interface ImportMetaEnv {
|
||||
readonly VITE_BUILD_TYPE: string
|
||||
readonly VITE_BUILD_TARGE: string
|
||||
}
|
||||
|
||||
interface ImportMeta {
|
||||
readonly env: ImportMetaEnv
|
||||
}
|
@ -1,4 +1,3 @@
|
||||
// import PreprocessorDirectives from 'unplugin-preprocessor-directives/vite';
|
||||
import obfuscator from 'rollup-plugin-obfuscator';
|
||||
import cp from 'vite-plugin-cp';
|
||||
import { UserConfig, defineConfig } from 'vite';
|
||||
|
Loading…
Reference in New Issue
Block a user