diff --git a/app/modules/tauri.ts b/app/modules/tauri.ts index 9a04ca1..53208c4 100644 --- a/app/modules/tauri.ts +++ b/app/modules/tauri.ts @@ -1,4 +1,5 @@ import * as tauriApp from "@tauri-apps/api/app"; +import * as tauriWebviewWindow from "@tauri-apps/api/webviewWindow"; import * as tauriFs from "@tauri-apps/plugin-fs"; import * as tauriNotification from "@tauri-apps/plugin-notification"; import * as tauriOs from "@tauri-apps/plugin-os"; @@ -12,6 +13,7 @@ const capitalize = (name: string) => { const tauriModules = [ { module: tauriApp, prefix: "App", importPath: "@tauri-apps/api/app" }, + { module: tauriWebviewWindow, prefix: "WebviewWindow", importPath: "@tauri-apps/api/webviewWindow" }, { module: tauriShell, prefix: "Shell", importPath: "@tauri-apps/plugin-shell" }, { module: tauriOs, prefix: "Os", importPath: "@tauri-apps/plugin-os" }, { module: tauriNotification, prefix: "Notification", importPath: "@tauri-apps/plugin-notification" }, diff --git a/app/pages/webview.vue b/app/pages/webview.vue new file mode 100644 index 0000000..c6fcdcf --- /dev/null +++ b/app/pages/webview.vue @@ -0,0 +1,48 @@ + + + + + Create external Webview + + + Create internal Webview + + + + + + diff --git a/eslint.config.mjs b/eslint.config.mjs index 178befc..3004088 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -29,6 +29,7 @@ export default eslintConfig( "vue/comma-dangle": ["warn", "never"], "antfu/top-level-function": "off", "antfu/if-newline": "off", + "new-cap": "off", "node/prefer-global/process": ["off"] } }, diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 059eb4f..f20ef16 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -29,7 +29,10 @@ serde_json = "1" [dependencies.tauri] version = "2.2.5" -features = [ "tray-icon" ] +features = [ + "tray-icon", + "unstable" +] [dependencies.serde] version = "1" diff --git a/src-tauri/capabilities/main.json b/src-tauri/capabilities/main.json index 65c05f0..a17f416 100644 --- a/src-tauri/capabilities/main.json +++ b/src-tauri/capabilities/main.json @@ -1,9 +1,10 @@ { "$schema": "../gen/schemas/desktop-schema.json", "identifier": "main", - "description": "Capabilities for the main window", + "description": "Capabilities for the app window", "windows": [ - "main" + "main", + "secondary" ], "permissions": [ "core:path:default", @@ -38,6 +39,8 @@ "os:allow-locale", "fs:allow-document-read", "fs:allow-document-write", - "store:default" + "store:default", + "core:webview:allow-create-webview", + "core:webview:allow-create-webview-window" ] } diff --git a/src-tauri/gen/schemas/capabilities.json b/src-tauri/gen/schemas/capabilities.json index bb04784..df1bbc0 100644 --- a/src-tauri/gen/schemas/capabilities.json +++ b/src-tauri/gen/schemas/capabilities.json @@ -1 +1 @@ -{"main":{"identifier":"main","description":"Capabilities for the main window","local":true,"windows":["main"],"permissions":["core:path:default","core:event:default","core:window:default","core:app:default","core:resources:default","core:menu:default","core:tray:default","shell:allow-open",{"identifier":"shell:allow-execute","allow":[{"args":["-c",{"validator":"\\S+"}],"cmd":"sh","name":"exec-sh","sidecar":false}]},"notification:default","os:allow-platform","os:allow-arch","os:allow-family","os:allow-version","os:allow-locale","fs:allow-document-read","fs:allow-document-write","store:default"]}} \ No newline at end of file +{"main":{"identifier":"main","description":"Capabilities for the app window","local":true,"windows":["main","secondary"],"permissions":["core:path:default","core:event:default","core:window:default","core:app:default","core:resources:default","core:menu:default","core:tray:default","shell:allow-open",{"identifier":"shell:allow-execute","allow":[{"args":["-c",{"validator":"\\S+"}],"cmd":"sh","name":"exec-sh","sidecar":false}]},"notification:default","os:allow-platform","os:allow-arch","os:allow-family","os:allow-version","os:allow-locale","fs:allow-document-read","fs:allow-document-write","store:default","core:webview:allow-create-webview","core:webview:allow-create-webview-window"]}} \ No newline at end of file