diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index ac3f9ed7..6bfacc36 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -2762,7 +2762,8 @@ dependencies = [ [[package]] name = "tauri-plugin-localhost" version = "0.1.0" -source = "git+https://github.com/icidasset/tauri-plugin-localhost?branch=127.0.0.1#e12353ad5343066470b8d1cd5296f7a1974e9909" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f20786ccff879045f6bafec445fb5c6740c0c057372d2f992ae1281e4658c681" dependencies = [ "serde_json", "tauri", diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index dd9d10b3..5becfe73 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -7,7 +7,7 @@ "devPath": "../build", "beforeDevCommand": "", "beforeBuildCommand": "", - "withGlobalTauri": false + "withGlobalTauri": true }, "tauri": { "bundle": { diff --git a/src/Javascript/index.js b/src/Javascript/index.js index 4ea6baea..28d5239a 100644 --- a/src/Javascript/index.js +++ b/src/Javascript/index.js @@ -116,7 +116,15 @@ function initialise(reg) { // Other ports app.ports.openUrlOnNewPage.subscribe(url => { - window.open(url, "_blank") + if (__TAURI__) { + __TAURI__.shell.open( + url.includes("://") ? url : `${location.origin}/${url.replace(/^\.\//, "")}` + ) + + } else { + window.open(url, "_blank") + + } }) app.ports.reloadApp.subscribe(_ => {