feat(opener): add inAppBrowser option for iOS and Android (#2803)

This commit is contained in:
Lucas Fernandes Nogueira
2025-06-24 16:43:01 -03:00
committed by GitHub
parent 9799f0dbab
commit 2aec8ff4c4
8 changed files with 69 additions and 18 deletions
@@ -83,6 +83,15 @@
},
"store:default",
"opener:default",
{
"identifier": "opener:allow-open-url",
"allow": [
{
"url": "https://*",
"app": "inAppBrowser"
}
]
},
{
"identifier": "opener:allow-open-path",
"allow": [{ "path": "$APPDATA" }, { "path": "$APPDATA/**" }]
+4 -2
View File
@@ -1,10 +1,12 @@
<script>
import * as opener from '@tauri-apps/plugin-opener'
import { platform } from '@tauri-apps/plugin-os'
export let onMessage
let url = ''
let urlProgram = ''
let url = 'https://tauri.app'
let urlProgram =
platform() === 'ios' || platform() === 'android' ? 'inAppBrowser' : ''
function openUrl() {
opener.openUrl(url, urlProgram ? urlProgram : undefined).catch(onMessage)
}