mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-04-27 11:56:05 +02:00
feat(opener): add inAppBrowser option for iOS and Android (#2803)
This commit is contained in:
committed by
GitHub
parent
9799f0dbab
commit
2aec8ff4c4
@@ -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/**" }]
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user