Remote tabs: finishing touches

This commit is contained in:
James Magahern
2022-08-05 18:55:19 -07:00
parent 61773b97db
commit e8c6111592
11 changed files with 273 additions and 62 deletions

View File

@@ -21,8 +21,8 @@ class Tab: NSObject, SBRProcessBundleBridgeDelegate
get {
TabInfo(
title: loadedWebView?.title,
url: loadedWebView?.url ?? self.homeURL,
favicon: self.favicon,
urlString: loadedWebView?.url?.absoluteString ?? self.homeURL?.absoluteString,
faviconData: self.favicon?.pngData(),
identifier: self.identifier
)
}
@@ -45,7 +45,15 @@ class Tab: NSObject, SBRProcessBundleBridgeDelegate
private var loadedWebView: WKWebView? = nil
public var title: String? { get { tabInfo.title } }
public var url: URL? { get { tabInfo.url } }
public var url: URL? {
get {
if let urlString = tabInfo.urlString {
return URL(string: urlString)
}
return nil
}
}
public var javaScriptEnabled: Bool = false {
didSet { bridge.allowAllScripts = javaScriptEnabled }