apache / cordova-ios

Apache Cordova iOS

Home Page:https://cordova.apache.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WKWebViewConfiguration is always ignored

Durzan666 opened this issue · comments

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

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above