apache / cordova-ios

Apache Cordova iOS
https://cordova.apache.org/
Apache License 2.0
2.15k stars 986 forks source link

WKWebViewConfiguration is always ignored #1423

Open Durzan666 opened 3 weeks ago

Durzan666 commented 3 weeks ago

Bug Report

Problem

What is expected to happen?

The WKWebViewConfiguration configured in CDVWebViewEngineConfigurationDelegate.configuration() is applied to WebView

What does actually happen?

The WKWebViewConfiguration configured in CDVWebViewEngineConfigurationDelegate.configuration() is ignored and not applied to WebView

Information

CDVViewController calls CDVWebViewEngineConfigurationDelegate.configuration() as expected but the check if CDVWebViewEngine can be called using the method initWithFrame:(CGRect)frame configuration:(nullable WKWebViewConfiguration *)configuration fails (see here).

Command or Code

I discovered this behaviour using this code

extension CDVViewController: CDVWebViewEngineConfigurationDelegate {
    public func configuration() -> WKWebViewConfiguration {
        let config = WKWebViewConfiguration()
        config.ignoresViewportScaleLimits = true
        return config
    }
}

Environment, Platform, Device

Ipad Pro (10.5) iPadOS 17.4.1

Version information

cordova-ios@7.1.0

Checklist