Add support for becoming a default browser
This commit is contained in:
@@ -296,6 +296,11 @@ class BrowserViewController: UIViewController, WKNavigationDelegate, WKUIDelegat
|
|||||||
iconView.someScriptsAllowed = scriptsAllowedForHost
|
iconView.someScriptsAllowed = scriptsAllowedForHost
|
||||||
iconView.setBlockedScriptsNumber(numBlockedScripts)
|
iconView.setBlockedScriptsNumber(numBlockedScripts)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public func createNewTab(withURL url: URL?) {
|
||||||
|
let newTab = tabController.createNewTab(url: url)
|
||||||
|
self.tab = newTab
|
||||||
|
}
|
||||||
|
|
||||||
// MARK: UIPopoverPresentationControllerDelegate
|
// MARK: UIPopoverPresentationControllerDelegate
|
||||||
|
|
||||||
@@ -520,8 +525,7 @@ class BrowserViewController: UIViewController, WKNavigationDelegate, WKUIDelegat
|
|||||||
}
|
}
|
||||||
|
|
||||||
func createTab(_ sender: Any?) {
|
func createTab(_ sender: Any?) {
|
||||||
let newTab = tabController.createNewTab(url: nil)
|
createNewTab(withURL: nil)
|
||||||
self.tab = newTab
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func previousTab(_ sender: Any?) {
|
func previousTab(_ sender: Any?) {
|
||||||
|
|||||||
@@ -24,10 +24,22 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
|||||||
window.makeKeyAndVisible()
|
window.makeKeyAndVisible()
|
||||||
self.window = window
|
self.window = window
|
||||||
|
|
||||||
|
if let urlContext = connectionOptions.urlContexts.first {
|
||||||
|
let url = urlContext.url
|
||||||
|
browserViewController.tab.beginLoadingURL(url)
|
||||||
|
}
|
||||||
|
|
||||||
#if targetEnvironment(macCatalyst)
|
#if targetEnvironment(macCatalyst)
|
||||||
windowScene.titlebar?.titleVisibility = .hidden
|
windowScene.titlebar?.titleVisibility = .hidden
|
||||||
windowScene.titlebar?.separatorStyle = .none
|
windowScene.titlebar?.separatorStyle = .none
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>)
|
||||||
|
{
|
||||||
|
for urlContext in URLContexts {
|
||||||
|
browserViewController.createNewTab(withURL: urlContext.url)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,20 @@
|
|||||||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>1.0</string>
|
<string>1.0</string>
|
||||||
|
<key>CFBundleURLTypes</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleTypeRole</key>
|
||||||
|
<string>Viewer</string>
|
||||||
|
<key>CFBundleURLName</key>
|
||||||
|
<string>net.buzzert.rosslerattix</string>
|
||||||
|
<key>CFBundleURLSchemes</key>
|
||||||
|
<array>
|
||||||
|
<string>http</string>
|
||||||
|
<string>https</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>1</string>
|
<string>1</string>
|
||||||
<key>LSRequiresIPhoneOS</key>
|
<key>LSRequiresIPhoneOS</key>
|
||||||
|
|||||||
@@ -6,5 +6,7 @@
|
|||||||
<true/>
|
<true/>
|
||||||
<key>com.apple.security.network.client</key>
|
<key>com.apple.security.network.client</key>
|
||||||
<true/>
|
<true/>
|
||||||
|
<key>com.apple.developer.web-browser</key>
|
||||||
|
<true/>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
Reference in New Issue
Block a user