1import { Button, List, Navigation, NavigationStack, Script, } from "scripting"
2
3function Example() {
4 return <NavigationStack>
5 <List
6 navigationTitle={"Safari"}
7 navigationBarTitleDisplayMode={"inline"}
8 >
9 <Button
10 title={"Open URL in system default browser"}
11 action={() => {
12 Safari.openURL("https://github.com")
13 }}
14 />
15
16 <Button
17 title={"Open URL in-app browser"}
18 action={async () => {
19 await Safari.present("https://github.com", false)
20 console.log("Dismissed")
21 }}
22 />
23 </List>
24 </NavigationStack>
25}
26
27async function run() {
28 await Navigation.present({
29 element: <Example />
30 })
31 Script.exit()
32}
33
34run()