2017-05-26 22:22:31 +02:00
|
|
|
//
|
|
|
|
// Browser.swift
|
|
|
|
// Evergren
|
|
|
|
//
|
|
|
|
// Created by Brent Simmons on 2/23/16.
|
|
|
|
// Copyright © 2016 Ranchero Software, LLC. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
import RSWeb
|
|
|
|
|
2017-10-06 03:12:58 +02:00
|
|
|
struct Browser {
|
2017-05-26 22:22:31 +02:00
|
|
|
|
2017-10-06 03:12:58 +02:00
|
|
|
static func open(_ urlString: String) {
|
|
|
|
// Opens according to prefs.
|
2018-12-28 06:34:21 +01:00
|
|
|
open(urlString, inBackground: AppDefaults.openInBrowserInBackground)
|
2017-10-06 03:12:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static func open(_ urlString: String, inBackground: Bool) {
|
|
|
|
if let url = URL(string: urlString) {
|
|
|
|
MacWebBrowser.openURL(url, inBackground: inBackground)
|
|
|
|
}
|
2017-05-26 22:22:31 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|