|
@@ -198,7 +198,6 @@ class WebxdcViewController: WebViewViewController {
|
|
let willBeRemoved = parent == nil
|
|
let willBeRemoved = parent == nil
|
|
navigationController?.interactivePopGestureRecognizer?.isEnabled = willBeRemoved
|
|
navigationController?.interactivePopGestureRecognizer?.isEnabled = willBeRemoved
|
|
if willBeRemoved {
|
|
if willBeRemoved {
|
|
- // remove observer
|
|
|
|
let nc = NotificationCenter.default
|
|
let nc = NotificationCenter.default
|
|
if let webxdcUpdateObserver = webxdcUpdateObserver {
|
|
if let webxdcUpdateObserver = webxdcUpdateObserver {
|
|
nc.removeObserver(webxdcUpdateObserver)
|
|
nc.removeObserver(webxdcUpdateObserver)
|
|
@@ -229,7 +228,6 @@ class WebxdcViewController: WebViewViewController {
|
|
}
|
|
}
|
|
|
|
|
|
override func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {
|
|
override func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {
|
|
- // TODO: what about tel://
|
|
|
|
if let url = navigationAction.request.url {
|
|
if let url = navigationAction.request.url {
|
|
if url.scheme == "mailto" {
|
|
if url.scheme == "mailto" {
|
|
openChatFor(url: url)
|
|
openChatFor(url: url)
|
|
@@ -262,7 +260,6 @@ class WebxdcViewController: WebViewViewController {
|
|
}
|
|
}
|
|
|
|
|
|
private func loadRestrictedHtml() {
|
|
private func loadRestrictedHtml() {
|
|
- // TODO: compile only once
|
|
|
|
WKContentRuleListStore.default().compileContentRuleList(
|
|
WKContentRuleListStore.default().compileContentRuleList(
|
|
forIdentifier: "WebxdcContentBlockingRules",
|
|
forIdentifier: "WebxdcContentBlockingRules",
|
|
encodedContentRuleList: blockRules) { (contentRuleList, error) in
|
|
encodedContentRuleList: blockRules) { (contentRuleList, error) in
|