4496bac2db
- tauri.conf.json windows=[]:不再自动创建主窗口 - lib.rs setup 中用 WebviewWindowBuilder 手动创建主窗口,builder 上设置 .on_new_window(|_, _| NewWindowResponse::Deny)——从原生层阻止 window.open / target=_blank 被 Tauri 转给系统浏览器(这是唯一可靠的方式,Webview 实例的 on_new_window 被 unstable feature 门控不可用) - 窗口配置保持原样:标题云超服、1280x800、最小 960x600、可调整大小 - 配合前端 window.open 守卫 + <a> 点击拦截器,形成原生+前端双层拦截
84 lines
2.6 KiB
JSON
84 lines
2.6 KiB
JSON
{
|
|
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
|
"productName": "YunOPC-Hub",
|
|
"identifier": "cn.pinesound.opc.hub",
|
|
"build": {
|
|
"frontendDist": "../dist-tauri",
|
|
"devUrl": "http://localhost:8093/tauri.html",
|
|
"beforeDevCommand": "vite --mode tauri",
|
|
"beforeBuildCommand": "npm run build:tauri-bootstrap"
|
|
},
|
|
"app": {
|
|
"withGlobalTauri": false,
|
|
"windows": [],
|
|
"security": {
|
|
"csp": "default-src 'self'; connect-src 'self' http://127.0.0.1:* ws://127.0.0.1:* ipc: http://ipc.localhost https://opc.pinesound.cn; script-src 'self'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; img-src 'self' asset: http://asset.localhost blob: data: https:; frame-src 'self' https: http: data:;"
|
|
}
|
|
},
|
|
"bundle": {
|
|
"active": true,
|
|
"targets": [
|
|
"app",
|
|
"dmg",
|
|
"nsis"
|
|
],
|
|
"icon": [
|
|
"icons/icon.icns",
|
|
"icons/icon.ico"
|
|
],
|
|
"resources": [
|
|
"binaries/qwenpaw-backend",
|
|
"binaries/python-runtime",
|
|
"binaries/node-runtime",
|
|
"LICENSE",
|
|
"LICENSE_QwenPaw",
|
|
"NOTICE"
|
|
],
|
|
"windows": {
|
|
"webviewInstallMode": {
|
|
"type": "downloadBootstrapper",
|
|
"silent": true
|
|
},
|
|
"nsis": {
|
|
"installerIcon": "../../scripts/pack/assets/icon.ico",
|
|
"uninstallerIcon": "../../scripts/pack/assets/icon.ico",
|
|
"installerHooks": "nsis-hooks.nsh",
|
|
"languages": [
|
|
"English",
|
|
"SimpChinese",
|
|
"Indonesian",
|
|
"Japanese",
|
|
"Russian",
|
|
"PortugueseBR",
|
|
"Vietnamese"
|
|
],
|
|
"customLanguageFiles": {
|
|
"English": "nsis-languages/English.nsh",
|
|
"SimpChinese": "nsis-languages/SimpChinese.nsh",
|
|
"Indonesian": "nsis-languages/Indonesian.nsh",
|
|
"Japanese": "nsis-languages/Japanese.nsh",
|
|
"Russian": "nsis-languages/Russian.nsh",
|
|
"PortugueseBR": "nsis-languages/PortugueseBR.nsh"
|
|
},
|
|
"compression": "zlib",
|
|
"displayLanguageSelector": false
|
|
}
|
|
},
|
|
"macOS": {
|
|
"minimumSystemVersion": "14.0"
|
|
},
|
|
"createUpdaterArtifacts": true
|
|
},
|
|
"plugins": {
|
|
"updater": {
|
|
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDkwRTBDNDRBRTJENTUxQTIKUldTaVVkWGlTc1Rna0lwZ3MzQ3J2KzFpZG5obExUT3B6SnRoeU4wcVJiZXRrN3B5Nlp4MzlLaWsK",
|
|
"endpoints": [
|
|
"https://opc.pinesound.cn/desktop-updates/latest.json"
|
|
],
|
|
"windows": {
|
|
"installMode": "passive"
|
|
}
|
|
}
|
|
},
|
|
"mainBinaryName": "yunopc-hub"
|
|
} |