Open oa-s opened 1 year ago
@hboon it looks like we need to add pases handling here, replaced existing code
func webView(_ webView: WKWebView, createWebViewWith configuration: WKWebViewConfiguration, for navigationAction: WKNavigationAction, windowFeatures: WKWindowFeatures) -> WKWebView? {
if navigationAction.targetFrame == nil {
browserViewController.webView.load(navigationAction.request)
}
return nil
}
with such code, popups displaying in same way as in Safary
func webView(_ webView: WKWebView,
createWebViewWith configuration: WKWebViewConfiguration,
for navigationAction: WKNavigationAction,
windowFeatures: WKWindowFeatures) -> WKWebView? {
// if navigationAction.targetFrame == nil {
// browserViewController.webView.load(navigationAction.request)
// return nil
// } else {
let view = browserViewController.view!
let popupWebView = WKWebView(frame: view.bounds, configuration: configuration)
popupWebView.navigationDelegate = self
popupWebView.uiDelegate = self
popupWebView.configuration.preferences.javaScriptCanOpenWindowsAutomatically = true
popupWebView.configuration.preferences.javaScriptEnabled = true
view.addSubview(popupWebView)
NSLayoutConstraint.activate([
popupWebView.widthAnchor.constraint(equalTo: view.widthAnchor),
popupWebView.heightAnchor.constraint(equalTo: view.heightAnchor),
popupWebView.centerXAnchor.constraint(equalTo: view.centerXAnchor),
popupWebView.centerYAnchor.constraint(equalTo: view.centerYAnchor)
])
self.popupWebView = popupWebView
return popupWebView
// }
}
to handle all created web views we would need to make pages, with opening a new page for browser.
any ideas?
Hmm. That means having to handle open windows, and all the window management support, right? Let’s see if it’s possible that they run without pop ups? I think there’s a redirect mode.
haven't find any tips to solve this, tabs handling could bring additional work and bugs
We don’t have to fix it by adding pop up support. Just let them know we don’t. But is the reloading an issue? Why is it doing that?
Link https://smarttokenlabs.atlassian.net/browse/TKS-602