mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-04-21 11:26:15 +02:00
feat(opener): add inAppBrowser option for iOS and Android (#2803)
This commit is contained in:
committed by
GitHub
parent
9799f0dbab
commit
2aec8ff4c4
@@ -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