AlphaWallet / alpha-wallet-ios

An advanced Ethereum/EVM mobile wallet
https://www.alphawallet.com
MIT License
595 stars 366 forks source link

Attestastion-Connect. OTP form opens again after signing Alpha wallet in Attestation on mobile #6819

Open oa-s opened 1 year ago

oa-s commented 1 year ago

Link https://smarttokenlabs.atlassian.net/browse/TKS-602

oa-s commented 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?

hboon commented 1 year ago

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.

oa-s commented 1 year ago

haven't find any tips to solve this, tabs handling could bring additional work and bugs

hboon commented 1 year ago

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?