 struct WebBrowserManager {
     private static let defaults = UserDefaults.standard
     private static let defaultBrowserKey = "DefaultBrowserKey"
+
+    /**
+        Returns the default browser the user has choosen to open any links in
+        Rocket Chat. If none was choosen the default option is set to .inAppSafari.
+     */
     static var browser: WebBrowserApp {
         guard
             let browserRaw = UserDefaults.standard.string(forKey: defaultBrowserKey),

}

extension WebBrowserApp {
    func appSchemeURL(forURL url: URL) -> URL? {
        let scheme = url.scheme ?? ""
        var absoluteString = url.absoluteString


        return browser
    }

    /**
        Open the given URL using the default browser the user has choosen.

        - parameter url: Any URL that can be opened using a web browser app.
     */
    static func open(url: URL) {
        browser.open(url: url)
    }

    /**
        Set the given web browser app as the default option
        to open any links in Rocket Chat.

        - parameter defaultBrowser: One of WebBrowserApp member values.
     */
    static func set(defaultBrowser: WebBrowserApp) {
        defaults.set(defaultBrowser.rawValue, forKey: defaultBrowserKey)
    }

    /**
        Clears the current selected default browser
     */
    static func clearDefaultBrowser() {
        defaults.set(nil, forKey: defaultBrowserKey)
    }
