diff --git a/README.md b/README.md index 70c4884f..412132e6 100644 --- a/README.md +++ b/README.md @@ -142,6 +142,16 @@ Whether to use a dark styled keyboard on iOS Ionic apps work better if the WKWebView is not scrollable, so the scroll is disabled by default, but can be enabled with this preference. This only affects the main ScrollView of the WKWebView, so only affects the body, not other scrollable components. +#### WKFullScreenEnabled + +```xml + +``` + +Default value is `false`. + +Whether to enable fullscreen functions in WKWebView. If enabled, the functions document.documentElement.webkitRequestFullscreen and document.documentElement.webkitRequestFullScreen will be available. + ## Plugin Requirements * **Cordova CLI**: 7.1.0+ diff --git a/src/ios/CDVWKWebViewEngine.m b/src/ios/CDVWKWebViewEngine.m index d6b24084..72a287cc 100644 --- a/src/ios/CDVWKWebViewEngine.m +++ b/src/ios/CDVWKWebViewEngine.m @@ -200,6 +200,9 @@ - (WKWebViewConfiguration*) createConfigurationFromSettings:(NSDictionary*)setti ) { userAgent = [NSString stringWithFormat:@"%@ %@", userAgent, [settings cordovaSettingForKey:@"AppendUserAgent"]]; } + if([settings cordovaBoolSettingForKey:@"WKFullScreenEnabled" defaultValue:NO]){ + [configuration.preferences setValue:[NSNumber numberWithBool:YES] forKey:@"fullScreenEnabled"]; + } configuration.applicationNameForUserAgent = userAgent; configuration.allowsInlineMediaPlayback = [settings cordovaBoolSettingForKey:@"AllowInlineMediaPlayback" defaultValue:YES]; configuration.suppressesIncrementalRendering = [settings cordovaBoolSettingForKey:@"SuppressesIncrementalRendering" defaultValue:NO];