https://github.com/oliveroneill/webbrowser
Small Swift Library for opening URLs in default browser
https://github.com/oliveroneill/webbrowser
browser linux script swift
Last synced: 6 months ago
JSON representation
Small Swift Library for opening URLs in default browser
- Host: GitHub
- URL: https://github.com/oliveroneill/webbrowser
- Owner: oliveroneill
- License: mit
- Created: 2018-08-21T22:35:21.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-25T01:01:32.000Z (over 7 years ago)
- Last Synced: 2025-02-07T14:47:50.346Z (about 1 year ago)
- Topics: browser, linux, script, swift
- Language: Swift
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# WebBrowser
A small Swift library for opening URLs in the web browser from command line.
This was built for desktop Swift scripts and is compatible with Linux and
macOS.
I have not tested it on Linux yet.
## Installation
Add this to your Package.swift:
```swift
.package(url: "https://github.com/oliveroneill/WebBrowser.git", .upToNextMajor(from: "1.0.0")),
```
## Usage
```swift
import WebBrowser
do {
try WebBrowser.open(url: URL(string: "http://google.com/")!)
} catch {
// handle error
}
```