Add support for becoming a default browser

This commit is contained in:
James Magahern
2020-09-30 15:23:05 -07:00
parent 6e0e2a0f20
commit d725bbb9d7
4 changed files with 34 additions and 2 deletions

View File

@@ -24,10 +24,22 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
window.makeKeyAndVisible()
self.window = window
if let urlContext = connectionOptions.urlContexts.first {
let url = urlContext.url
browserViewController.tab.beginLoadingURL(url)
}
#if targetEnvironment(macCatalyst)
windowScene.titlebar?.titleVisibility = .hidden
windowScene.titlebar?.separatorStyle = .none
#endif
}
func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>)
{
for urlContext in URLContexts {
browserViewController.createNewTab(withURL: urlContext.url)
}
}
}