Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overriding navigationDelegate causes ErikError.noContent #58

Open
L3afMe opened this issue Sep 5, 2021 · 1 comment
Open

Overriding navigationDelegate causes ErikError.noContent #58

L3afMe opened this issue Sep 5, 2021 · 1 comment

Comments

@L3afMe
Copy link

L3afMe commented Sep 5, 2021

Overriding navigationDeledate causes ErikError.noContent,
if you remove the view.navigationDelegate = self line then it content is produced.

class Test: LayoutEngineNavigationDelegate {
    let view: WKWebView
    let browser: Erik
    
    override init() {
        view = WKWebView()
        browser = Erik(webView: view)
        super.init()
        view.navigationDelegate = self
    }
    
    func test() {
        browser.visit(url: URL(string: "https://google.com")!) { (document, err) in
            debugPrint(err as Any)
            debugPrint(document as Any)
        }
    }
}
@L3afMe
Copy link
Author

L3afMe commented Sep 5, 2021

It still occurs if you use

class Test: LayoutEngineNavigationDelegate {
    override init() {
        super.init()
    }
}

/* ... */

if let engine = Erik.sharedInstance.layoutEngine as? WebKitLayoutEngine {
    let webView: WKWebView = engine.webView
    webView.navigationDelegate = Test()
}

Erik.visit(url: URL(string: "https://google.com")!) { (document, err) in
    debugPrint(err as Any)
    debugPrint(document as Any)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant