You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Create a configuration for the webView, which sets the subset of properties that Interface Builder in Xcode (version 15.4) shows when adding a WKWebView. The Xcode titles are put in the comments:
configuration.mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeAll; // Interaction: For Audio/Video Playback -> Disable automatic start explicitely, since the video will be presented fullscreen after page load.
66
+
configuration.dataDetectorTypes = WKDataDetectorTypeAll; // Data Detectors: All
configuration.preferences.javaScriptEnabled = YES; // Deprecated since iOS 14.0
72
+
}
73
+
configuration.preferences.javaScriptCanOpenWindowsAutomatically = NO; // JavaScript: Can Auto-open Windows -> Disable explicitely for security reasons.
74
+
return configuration;
75
+
}
76
+
58
77
- (void)loadView {
59
78
// Set up the main view
60
79
self.view = [[UIView alloc] init];
@@ -147,24 +166,9 @@ - (void)loadView {
147
166
- (void)viewDidLoad {
148
167
[superviewDidLoad];
149
168
150
-
// Create a configuration for the webView, which sets the subset of properties that Interface Builder in Xcode (version 15.4) shows when adding a WKWebView. The Xcode titles are put in the comments:
configuration.mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeAll; // Interaction: For Audio/Video Playback -> Disable automatic start explicitely, since the video will be presented fullscreen after page load.
157
-
configuration.dataDetectorTypes = WKDataDetectorTypeAll; // Data Detectors: All
configuration.preferences.javaScriptEnabled = YES; // Deprecated since iOS 14.0
163
-
}
164
-
configuration.preferences.javaScriptCanOpenWindowsAutomatically = NO; // JavaScript: Can Auto-open Windows -> Disable explicitely for security reasons.
165
169
166
170
// Initialize the webView with the configuration in an empty frame (size will be updated in `-viewWillLayoutSubviews` after constraints have been added):
0 commit comments