7e8916a0a04ffde3078a6892c7a3be24c3133ae8
[WebKit-https.git] / Source / WebKit / UIProcess / API / Cocoa / WKWebViewConfiguration.mm
1 /*
2  * Copyright (C) 2014-2017 Apple Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23  * THE POSSIBILITY OF SUCH DAMAGE.
24  */
25
26 #import "config.h"
27 #import "WKWebViewConfigurationInternal.h"
28 #import <pal/spi/cocoa/NSKeyedArchiverSPI.h>
29
30 #import "APIPageConfiguration.h"
31 #import "VersionChecks.h"
32 #import "WKPreferences.h"
33 #import "WKProcessPool.h"
34 #import "WKRetainPtr.h"
35 #import "WKUserContentController.h"
36 #import "WKWebView.h"
37 #import "WKWebViewContentProviderRegistry.h"
38 #import "WebKit2Initialize.h"
39 #import "WebURLSchemeHandlerCocoa.h"
40 #import "_WKApplicationManifestInternal.h"
41 #import "_WKVisitedLinkStore.h"
42 #import "_WKWebsiteDataStoreInternal.h"
43 #import <WebCore/RuntimeApplicationChecks.h>
44 #import <WebCore/Settings.h>
45 #import <wtf/RetainPtr.h>
46 #import <wtf/URLParser.h>
47 #import <wtf/WeakObjCPtr.h>
48
49 #if PLATFORM(IOS_FAMILY)
50 #import "UIKitSPI.h"
51 #import <WebCore/Device.h>
52 #endif
53
54 template<typename T> class LazyInitialized {
55 public:
56     typedef typename WTF::GetPtrHelper<T>::PtrType PtrType;
57
58     template<typename F>
59     PtrType get(F&& f)
60     {
61         if (!m_isInitialized) {
62             m_value = f();
63             m_isInitialized = true;
64         }
65
66         return m_value.get();
67     }
68
69     void set(PtrType t)
70     {
71         m_value = t;
72         m_isInitialized = true;
73     }
74
75     void set(T&& t)
76     {
77         m_value = WTFMove(t);
78         m_isInitialized = true;
79     }
80
81     PtrType peek()
82     {
83         return m_value.get();
84     }
85
86 private:
87     bool m_isInitialized = false;
88     T m_value;
89 };
90
91 #if PLATFORM(IOS_FAMILY)
92
93 static _WKDragLiftDelay toDragLiftDelay(NSUInteger value)
94 {
95     if (value == _WKDragLiftDelayMedium)
96         return _WKDragLiftDelayMedium;
97     if (value == _WKDragLiftDelayLong)
98         return _WKDragLiftDelayLong;
99     return _WKDragLiftDelayShort;
100 }
101
102 static bool defaultShouldDecidePolicyBeforeLoadingQuickLookPreview()
103 {
104 #if USE(QUICK_LOOK)
105     static bool shouldDecide = linkedOnOrAfter(WebKit::SDKVersion::FirstThatDecidesPolicyBeforeLoadingQuickLookPreview);
106     return shouldDecide;
107 #else
108     return false;
109 #endif
110 }
111
112 #endif
113
114 @implementation WKWebViewConfiguration {
115     RefPtr<API::PageConfiguration> _pageConfiguration;
116     LazyInitialized<RetainPtr<WKProcessPool>> _processPool;
117     LazyInitialized<RetainPtr<WKPreferences>> _preferences;
118     LazyInitialized<RetainPtr<WKUserContentController>> _userContentController;
119     LazyInitialized<RetainPtr<_WKVisitedLinkStore>> _visitedLinkStore;
120     LazyInitialized<RetainPtr<WKWebsiteDataStore>> _websiteDataStore;
121     LazyInitialized<RetainPtr<WKWebpagePreferences>> _defaultWebpagePreferences;
122     WeakObjCPtr<WKWebView> _relatedWebView;
123     WeakObjCPtr<WKWebView> _alternateWebViewForNavigationGestures;
124     RetainPtr<NSString> _groupIdentifier;
125     LazyInitialized<RetainPtr<NSString>> _applicationNameForUserAgent;
126     NSTimeInterval _incrementalRenderingSuppressionTimeout;
127     BOOL _respectsImageOrientation;
128     BOOL _printsBackgrounds;
129     BOOL _allowsJavaScriptMarkup;
130     BOOL _convertsPositionStyleOnCopy;
131     BOOL _allowsMetaRefresh;
132     BOOL _allowUniversalAccessFromFileURLs;
133
134 #if PLATFORM(IOS_FAMILY)
135     LazyInitialized<RetainPtr<WKWebViewContentProviderRegistry>> _contentProviderRegistry;
136     BOOL _allowsInlineMediaPlayback;
137     BOOL _inlineMediaPlaybackRequiresPlaysInlineAttribute;
138     BOOL _allowsInlineMediaPlaybackAfterFullscreen;
139     _WKDragLiftDelay _dragLiftDelay;
140     BOOL _textInteractionGesturesEnabled;
141     BOOL _longPressActionsEnabled;
142     BOOL _systemPreviewEnabled;
143     BOOL _shouldDecidePolicyBeforeLoadingQuickLookPreview;
144 #endif
145
146     BOOL _invisibleAutoplayNotPermitted;
147     BOOL _mediaDataLoadsAutomatically;
148     BOOL _attachmentElementEnabled;
149     Class _attachmentFileWrapperClass;
150     BOOL _mainContentUserGestureOverrideEnabled;
151
152 #if PLATFORM(MAC)
153     WKRetainPtr<WKPageGroupRef> _pageGroup;
154     BOOL _showsURLsInToolTips;
155     BOOL _serviceControlsEnabled;
156     BOOL _imageControlsEnabled;
157     BOOL _requiresUserActionForEditingControlsManager;
158 #endif
159     BOOL _waitsForPaintAfterViewDidMoveToWindow;
160     BOOL _controlledByAutomation;
161
162 #if ENABLE(APPLE_PAY)
163     BOOL _applePayEnabled;
164 #endif
165     BOOL _needsStorageAccessFromFileURLsQuirk;
166     BOOL _legacyEncryptedMediaAPIEnabled;
167     BOOL _allowMediaContentTypesRequiringHardwareSupportAsFallback;
168     BOOL _colorFilterEnabled;
169     BOOL _incompleteImageBorderEnabled;
170     BOOL _shouldDeferAsynchronousScriptsUntilAfterDocumentLoad;
171     BOOL _drawsBackground;
172     BOOL _editableImagesEnabled;
173     BOOL _undoManagerAPIEnabled;
174
175     RetainPtr<NSString> _mediaContentTypesRequiringHardwareSupport;
176     RetainPtr<NSArray<NSString *>> _additionalSupportedImageTypes;
177 }
178
179 - (instancetype)init
180 {
181     if (!(self = [super init]))
182         return nil;
183
184     WebKit::InitializeWebKit2();
185
186     _pageConfiguration = API::PageConfiguration::create();
187
188 #if PLATFORM(IOS_FAMILY)
189 #if !PLATFORM(WATCHOS)
190     _allowsPictureInPictureMediaPlayback = YES;
191 #endif
192     _allowsInlineMediaPlayback = WebCore::deviceClass() == MGDeviceClassiPad;
193     _inlineMediaPlaybackRequiresPlaysInlineAttribute = !_allowsInlineMediaPlayback;
194     _allowsInlineMediaPlaybackAfterFullscreen = !_allowsInlineMediaPlayback;
195     _mediaDataLoadsAutomatically = NO;
196 #if !PLATFORM(WATCHOS)
197     if (WebKit::linkedOnOrAfter(WebKit::SDKVersion::FirstWithMediaTypesRequiringUserActionForPlayback))
198         _mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeAudio;
199     else
200 #endif
201         _mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeAll;
202     _ignoresViewportScaleLimits = NO;
203     _legacyEncryptedMediaAPIEnabled = NO;
204 #else
205     _mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeNone;
206     _mediaDataLoadsAutomatically = YES;
207     _userInterfaceDirectionPolicy = WKUserInterfaceDirectionPolicyContent;
208     _legacyEncryptedMediaAPIEnabled = YES;
209 #endif
210     _mainContentUserGestureOverrideEnabled = NO;
211     _invisibleAutoplayNotPermitted = NO;
212     _attachmentElementEnabled = NO;
213
214 #if PLATFORM(IOS_FAMILY)
215     _respectsImageOrientation = YES;
216     _printsBackgrounds = YES;
217 #endif
218
219 #if PLATFORM(MAC)
220     _printsBackgrounds = NO;
221     _respectsImageOrientation = NO;
222     _showsURLsInToolTips = NO;
223     _serviceControlsEnabled = NO;
224     _imageControlsEnabled = NO;
225     _requiresUserActionForEditingControlsManager = NO;
226 #endif
227     _waitsForPaintAfterViewDidMoveToWindow = YES;
228
229 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
230     _allowsAirPlayForMediaPlayback = YES;
231 #endif
232
233     _incrementalRenderingSuppressionTimeout = 5;
234     _allowsJavaScriptMarkup = YES;
235     _convertsPositionStyleOnCopy = NO;
236     _allowsMetaRefresh = YES;
237     _allowUniversalAccessFromFileURLs = NO;
238     _needsStorageAccessFromFileURLsQuirk = YES;
239
240 #if PLATFORM(IOS_FAMILY)
241     _selectionGranularity = WKSelectionGranularityDynamic;
242     _dragLiftDelay = toDragLiftDelay([[NSUserDefaults standardUserDefaults] integerForKey:@"WebKitDebugDragLiftDelay"]);
243 #if PLATFORM(WATCHOS)
244     _textInteractionGesturesEnabled = NO;
245     _longPressActionsEnabled = NO;
246 #else
247     _textInteractionGesturesEnabled = YES;
248     _longPressActionsEnabled = YES;
249 #endif
250     _systemPreviewEnabled = NO;
251     _shouldDecidePolicyBeforeLoadingQuickLookPreview = defaultShouldDecidePolicyBeforeLoadingQuickLookPreview();
252 #endif // PLATFORM(IOS_FAMILY)
253
254     _mediaContentTypesRequiringHardwareSupport = WebCore::Settings::defaultMediaContentTypesRequiringHardwareSupport();
255     _allowMediaContentTypesRequiringHardwareSupportAsFallback = YES;
256
257     _colorFilterEnabled = NO;
258     _incompleteImageBorderEnabled = NO;
259     _shouldDeferAsynchronousScriptsUntilAfterDocumentLoad = NO;
260     _drawsBackground = YES;
261
262     _editableImagesEnabled = NO;
263     _undoManagerAPIEnabled = NO;
264
265 #if ENABLE(APPLE_PAY)
266     _applePayEnabled = DEFAULT_APPLE_PAY_ENABLED;
267 #endif
268
269     return self;
270 }
271
272 - (NSString *)description
273 {
274     return [NSString stringWithFormat:@"<%@: %p; processPool = %@; preferences = %@>", NSStringFromClass(self.class), self, self.processPool, self.preferences];
275 }
276
277 + (BOOL)supportsSecureCoding
278 {
279     return YES;
280 }
281
282 - (void)encodeWithCoder:(NSCoder *)coder
283 {
284     [coder encodeObject:self.processPool forKey:@"processPool"];
285     [coder encodeObject:self.preferences forKey:@"preferences"];
286     [coder encodeObject:self.userContentController forKey:@"userContentController"];
287     [coder encodeObject:self.websiteDataStore forKey:@"websiteDataStore"];
288
289     [coder encodeBool:self.suppressesIncrementalRendering forKey:@"suppressesIncrementalRendering"];
290     [coder encodeObject:self.applicationNameForUserAgent forKey:@"applicationNameForUserAgent"];
291     [coder encodeBool:self.allowsAirPlayForMediaPlayback forKey:@"allowsAirPlayForMediaPlayback"];
292
293     [coder encodeBool:self._drawsBackground forKey:@"drawsBackground"];
294
295 #if PLATFORM(IOS_FAMILY)
296     [coder encodeInteger:self.dataDetectorTypes forKey:@"dataDetectorTypes"];
297     [coder encodeBool:self.allowsInlineMediaPlayback forKey:@"allowsInlineMediaPlayback"];
298     [coder encodeBool:self._allowsInlineMediaPlaybackAfterFullscreen forKey:@"allowsInlineMediaPlaybackAfterFullscreen"];
299     [coder encodeBool:self.mediaTypesRequiringUserActionForPlayback forKey:@"mediaTypesRequiringUserActionForPlayback"];
300     [coder encodeInteger:self.selectionGranularity forKey:@"selectionGranularity"];
301     [coder encodeBool:self.allowsPictureInPictureMediaPlayback forKey:@"allowsPictureInPictureMediaPlayback"];
302     [coder encodeBool:self.ignoresViewportScaleLimits forKey:@"ignoresViewportScaleLimits"];
303     [coder encodeInteger:self._dragLiftDelay forKey:@"dragLiftDelay"];
304     [coder encodeBool:self._textInteractionGesturesEnabled forKey:@"textInteractionGesturesEnabled"];
305     [coder encodeBool:self._longPressActionsEnabled forKey:@"longPressActionsEnabled"];
306     [coder encodeBool:self._systemPreviewEnabled forKey:@"systemPreviewEnabled"];
307     [coder encodeBool:self._shouldDecidePolicyBeforeLoadingQuickLookPreview forKey:@"shouldDecidePolicyBeforeLoadingQuickLookPreview"];
308 #else
309     [coder encodeInteger:self.userInterfaceDirectionPolicy forKey:@"userInterfaceDirectionPolicy"];
310 #endif
311 }
312
313 - (instancetype)initWithCoder:(NSCoder *)coder
314 {
315     if (!(self = [self init]))
316         return nil;
317
318     self.processPool = decodeObjectOfClassForKeyFromCoder([WKProcessPool class], @"processPool", coder);
319     self.preferences = decodeObjectOfClassForKeyFromCoder([WKPreferences class], @"preferences", coder);
320     self.userContentController = decodeObjectOfClassForKeyFromCoder([WKUserContentController class], @"userContentController", coder);
321     self.websiteDataStore = decodeObjectOfClassForKeyFromCoder([WKWebsiteDataStore class], @"websiteDataStore", coder);
322
323     self.suppressesIncrementalRendering = [coder decodeBoolForKey:@"suppressesIncrementalRendering"];
324     self.applicationNameForUserAgent = decodeObjectOfClassForKeyFromCoder([NSString class], @"applicationNameForUserAgent", coder);
325     self.allowsAirPlayForMediaPlayback = [coder decodeBoolForKey:@"allowsAirPlayForMediaPlayback"];
326
327     if ([coder containsValueForKey:@"drawsBackground"])
328         self._drawsBackground = [coder decodeBoolForKey:@"drawsBackground"];
329
330 #if PLATFORM(IOS_FAMILY)
331     self.dataDetectorTypes = [coder decodeIntegerForKey:@"dataDetectorTypes"];
332     self.allowsInlineMediaPlayback = [coder decodeBoolForKey:@"allowsInlineMediaPlayback"];
333     self._allowsInlineMediaPlaybackAfterFullscreen = [coder decodeBoolForKey:@"allowsInlineMediaPlaybackAfterFullscreen"];
334     self.mediaTypesRequiringUserActionForPlayback = [coder decodeBoolForKey:@"mediaTypesRequiringUserActionForPlayback"];
335     self.selectionGranularity = static_cast<WKSelectionGranularity>([coder decodeIntegerForKey:@"selectionGranularity"]);
336     self.allowsPictureInPictureMediaPlayback = [coder decodeBoolForKey:@"allowsPictureInPictureMediaPlayback"];
337     self.ignoresViewportScaleLimits = [coder decodeBoolForKey:@"ignoresViewportScaleLimits"];
338     self._dragLiftDelay = toDragLiftDelay([coder decodeIntegerForKey:@"dragLiftDelay"]);
339     self._textInteractionGesturesEnabled = [coder decodeBoolForKey:@"textInteractionGesturesEnabled"];
340     self._longPressActionsEnabled = [coder decodeBoolForKey:@"longPressActionsEnabled"];
341     self._systemPreviewEnabled = [coder decodeBoolForKey:@"systemPreviewEnabled"];
342     self._shouldDecidePolicyBeforeLoadingQuickLookPreview = [coder decodeBoolForKey:@"shouldDecidePolicyBeforeLoadingQuickLookPreview"];
343 #else
344     auto userInterfaceDirectionPolicyCandidate = static_cast<WKUserInterfaceDirectionPolicy>([coder decodeIntegerForKey:@"userInterfaceDirectionPolicy"]);
345     if (userInterfaceDirectionPolicyCandidate == WKUserInterfaceDirectionPolicyContent || userInterfaceDirectionPolicyCandidate == WKUserInterfaceDirectionPolicySystem)
346         self.userInterfaceDirectionPolicy = userInterfaceDirectionPolicyCandidate;
347 #endif
348
349     return self;
350 }
351
352 - (id)copyWithZone:(NSZone *)zone
353 {
354     WKWebViewConfiguration *configuration = [(WKWebViewConfiguration *)[[self class] allocWithZone:zone] init];
355
356     configuration->_pageConfiguration = _pageConfiguration->copy();
357     configuration.processPool = self.processPool;
358     configuration.preferences = self.preferences;
359     configuration.userContentController = self.userContentController;
360     configuration.websiteDataStore = self.websiteDataStore;
361     configuration.defaultWebpagePreferences = self.defaultWebpagePreferences;
362     configuration._visitedLinkStore = self._visitedLinkStore;
363     configuration._relatedWebView = _relatedWebView.get().get();
364     configuration._alternateWebViewForNavigationGestures = _alternateWebViewForNavigationGestures.get().get();
365 #if PLATFORM(IOS_FAMILY)
366     configuration._contentProviderRegistry = self._contentProviderRegistry;
367 #endif
368
369     configuration->_suppressesIncrementalRendering = self->_suppressesIncrementalRendering;
370     configuration.applicationNameForUserAgent = self.applicationNameForUserAgent;
371
372     configuration->_respectsImageOrientation = self->_respectsImageOrientation;
373     configuration->_printsBackgrounds = self->_printsBackgrounds;
374     configuration->_incrementalRenderingSuppressionTimeout = self->_incrementalRenderingSuppressionTimeout;
375     configuration->_allowsJavaScriptMarkup = self->_allowsJavaScriptMarkup;
376     configuration->_convertsPositionStyleOnCopy = self->_convertsPositionStyleOnCopy;
377     configuration->_allowsMetaRefresh = self->_allowsMetaRefresh;
378     configuration->_allowUniversalAccessFromFileURLs = self->_allowUniversalAccessFromFileURLs;
379
380     configuration->_invisibleAutoplayNotPermitted = self->_invisibleAutoplayNotPermitted;
381     configuration->_mediaDataLoadsAutomatically = self->_mediaDataLoadsAutomatically;
382     configuration->_attachmentElementEnabled = self->_attachmentElementEnabled;
383     configuration->_attachmentFileWrapperClass = self->_attachmentFileWrapperClass;
384     configuration->_mediaTypesRequiringUserActionForPlayback = self->_mediaTypesRequiringUserActionForPlayback;
385     configuration->_mainContentUserGestureOverrideEnabled = self->_mainContentUserGestureOverrideEnabled;
386     configuration->_waitsForPaintAfterViewDidMoveToWindow = self->_waitsForPaintAfterViewDidMoveToWindow;
387     configuration->_controlledByAutomation = self->_controlledByAutomation;
388
389 #if PLATFORM(IOS_FAMILY)
390     configuration->_allowsInlineMediaPlayback = self->_allowsInlineMediaPlayback;
391     configuration->_allowsInlineMediaPlaybackAfterFullscreen = self->_allowsInlineMediaPlaybackAfterFullscreen;
392     configuration->_inlineMediaPlaybackRequiresPlaysInlineAttribute = self->_inlineMediaPlaybackRequiresPlaysInlineAttribute;
393     configuration->_allowsPictureInPictureMediaPlayback = self->_allowsPictureInPictureMediaPlayback;
394     configuration->_selectionGranularity = self->_selectionGranularity;
395     configuration->_ignoresViewportScaleLimits = self->_ignoresViewportScaleLimits;
396     configuration->_dragLiftDelay = self->_dragLiftDelay;
397     configuration->_textInteractionGesturesEnabled = self->_textInteractionGesturesEnabled;
398     configuration->_longPressActionsEnabled = self->_longPressActionsEnabled;
399     configuration->_systemPreviewEnabled = self->_systemPreviewEnabled;
400     configuration->_shouldDecidePolicyBeforeLoadingQuickLookPreview = self->_shouldDecidePolicyBeforeLoadingQuickLookPreview;
401 #endif
402 #if PLATFORM(MAC)
403     configuration->_userInterfaceDirectionPolicy = self->_userInterfaceDirectionPolicy;
404     configuration->_showsURLsInToolTips = self->_showsURLsInToolTips;
405     configuration->_serviceControlsEnabled = self->_serviceControlsEnabled;
406     configuration->_imageControlsEnabled = self->_imageControlsEnabled;
407     configuration->_requiresUserActionForEditingControlsManager = self->_requiresUserActionForEditingControlsManager;
408     configuration->_pageGroup = self._pageGroup;
409 #endif
410 #if ENABLE(DATA_DETECTION) && PLATFORM(IOS_FAMILY)
411     configuration->_dataDetectorTypes = self->_dataDetectorTypes;
412 #endif
413 #if ENABLE(WIRELESS_TARGET_PLAYBACK)
414     configuration->_allowsAirPlayForMediaPlayback = self->_allowsAirPlayForMediaPlayback;
415 #endif
416 #if ENABLE(APPLE_PAY)
417     configuration->_applePayEnabled = self->_applePayEnabled;
418 #endif
419     configuration->_needsStorageAccessFromFileURLsQuirk = self->_needsStorageAccessFromFileURLsQuirk;
420
421     configuration->_mediaContentTypesRequiringHardwareSupport = adoptNS([self._mediaContentTypesRequiringHardwareSupport copyWithZone:zone]);
422     configuration->_additionalSupportedImageTypes = adoptNS([self->_additionalSupportedImageTypes copyWithZone:zone]);
423     configuration->_legacyEncryptedMediaAPIEnabled = self->_legacyEncryptedMediaAPIEnabled;
424     configuration->_allowMediaContentTypesRequiringHardwareSupportAsFallback = self->_allowMediaContentTypesRequiringHardwareSupportAsFallback;
425
426     configuration->_groupIdentifier = adoptNS([self->_groupIdentifier copyWithZone:zone]);
427     configuration->_colorFilterEnabled = self->_colorFilterEnabled;
428     configuration->_incompleteImageBorderEnabled = self->_incompleteImageBorderEnabled;
429     configuration->_shouldDeferAsynchronousScriptsUntilAfterDocumentLoad = self->_shouldDeferAsynchronousScriptsUntilAfterDocumentLoad;
430     configuration->_drawsBackground = self->_drawsBackground;
431
432     configuration->_editableImagesEnabled = self->_editableImagesEnabled;
433     configuration->_undoManagerAPIEnabled = self->_undoManagerAPIEnabled;
434
435     return configuration;
436 }
437
438 - (WKProcessPool *)processPool
439 {
440     return _processPool.get([] { return adoptNS([[WKProcessPool alloc] init]); });
441 }
442
443 - (void)setProcessPool:(WKProcessPool *)processPool
444 {
445     _processPool.set(processPool);
446 }
447
448 - (WKPreferences *)preferences
449 {
450     return _preferences.get([] { return adoptNS([[WKPreferences alloc] init]); });
451 }
452
453 - (void)setPreferences:(WKPreferences *)preferences
454 {
455     _preferences.set(preferences);
456 }
457
458 - (WKUserContentController *)userContentController
459 {
460     return _userContentController.get([] { return adoptNS([[WKUserContentController alloc] init]); });
461 }
462
463 - (void)setUserContentController:(WKUserContentController *)userContentController
464 {
465     _userContentController.set(userContentController);
466 }
467
468 - (WKWebsiteDataStore *)websiteDataStore
469 {
470     return _websiteDataStore.get([] { return [WKWebsiteDataStore defaultDataStore]; });
471 }
472
473 - (void)setWebsiteDataStore:(WKWebsiteDataStore *)websiteDataStore
474 {
475     _websiteDataStore.set(websiteDataStore);
476 }
477
478 - (WKWebpagePreferences *)defaultWebpagePreferences
479 {
480     return _defaultWebpagePreferences.get([] {
481         return WKWebpagePreferences.defaultPreferences;
482     });
483 }
484
485 - (void)setDefaultWebpagePreferences:(WKWebpagePreferences *)defaultWebpagePreferences
486 {
487     _defaultWebpagePreferences.set(defaultWebpagePreferences ?: WKWebpagePreferences.defaultPreferences);
488 }
489
490 static NSString *defaultApplicationNameForUserAgent()
491 {
492 #if PLATFORM(IOS_FAMILY)
493     return @"Mobile/15E148";
494 #else
495     return nil;
496 #endif
497 }
498
499 - (NSString *)applicationNameForUserAgent
500 {
501     return _applicationNameForUserAgent.get([] { return defaultApplicationNameForUserAgent(); });
502 }
503
504 - (void)setApplicationNameForUserAgent:(NSString *)applicationNameForUserAgent
505 {
506     _applicationNameForUserAgent.set(adoptNS([applicationNameForUserAgent copy]));
507 }
508
509 - (_WKVisitedLinkStore *)_visitedLinkStore
510 {
511     return _visitedLinkStore.get([] { return adoptNS([[_WKVisitedLinkStore alloc] init]); });
512 }
513
514 - (void)_setVisitedLinkStore:(_WKVisitedLinkStore *)visitedLinkStore
515 {
516     _visitedLinkStore.set(visitedLinkStore);
517 }
518
519 - (void)setURLSchemeHandler:(id <WKURLSchemeHandler>)urlSchemeHandler forURLScheme:(NSString *)urlScheme
520 {
521     if ([WKWebView handlesURLScheme:urlScheme])
522         [NSException raise:NSInvalidArgumentException format:@"'%@' is a URL scheme that WKWebView handles natively", urlScheme];
523
524     auto canonicalScheme = WTF::URLParser::maybeCanonicalizeScheme(urlScheme);
525     if (!canonicalScheme)
526         [NSException raise:NSInvalidArgumentException format:@"'%@' is not a valid URL scheme", urlScheme];
527
528     if (_pageConfiguration->urlSchemeHandlerForURLScheme(*canonicalScheme))
529         [NSException raise:NSInvalidArgumentException format:@"URL scheme '%@' already has a registered URL scheme handler", urlScheme];
530
531     _pageConfiguration->setURLSchemeHandlerForURLScheme(WebKit::WebURLSchemeHandlerCocoa::create(urlSchemeHandler), *canonicalScheme);
532 }
533
534 - (id <WKURLSchemeHandler>)urlSchemeHandlerForURLScheme:(NSString *)urlScheme
535 {
536     auto canonicalScheme = WTF::URLParser::maybeCanonicalizeScheme(urlScheme);
537     if (!canonicalScheme)
538         return nil;
539
540     auto handler = _pageConfiguration->urlSchemeHandlerForURLScheme(*canonicalScheme);
541     return handler ? static_cast<WebKit::WebURLSchemeHandlerCocoa*>(handler.get())->apiHandler() : nil;
542 }
543
544 ALLOW_DEPRECATED_DECLARATIONS_BEGIN
545
546 IGNORE_WARNINGS_BEGIN("deprecated-implementations")
547 - (_WKWebsiteDataStore *)_websiteDataStore
548 IGNORE_WARNINGS_END
549 {
550     return self.websiteDataStore ? adoptNS([[_WKWebsiteDataStore alloc] initWithDataStore:self.websiteDataStore]).autorelease() : nullptr;
551 }
552
553 IGNORE_WARNINGS_BEGIN("deprecated-implementations")
554 - (void)_setWebsiteDataStore:(_WKWebsiteDataStore *)websiteDataStore
555 IGNORE_WARNINGS_END
556 {
557     self.websiteDataStore = websiteDataStore ? websiteDataStore->_dataStore.get() : nullptr;
558 }
559
560 ALLOW_DEPRECATED_DECLARATIONS_END
561
562 #if PLATFORM(IOS_FAMILY)
563 - (WKWebViewContentProviderRegistry *)_contentProviderRegistry
564 {
565     return _contentProviderRegistry.get([self] { return adoptNS([[WKWebViewContentProviderRegistry alloc] initWithConfiguration:self]); });
566 }
567
568 - (void)_setContentProviderRegistry:(WKWebViewContentProviderRegistry *)registry
569 {
570     _contentProviderRegistry.set(registry);
571 }
572 #endif
573
574 - (Ref<API::PageConfiguration>)copyPageConfiguration
575 {
576     return _pageConfiguration->copy();
577 }
578
579 @end
580
581 @implementation WKWebViewConfiguration (WKPrivate)
582
583 - (WKWebView *)_relatedWebView
584 {
585     return _relatedWebView.getAutoreleased();
586 }
587
588 - (void)_setRelatedWebView:(WKWebView *)relatedWebView
589 {
590     _relatedWebView = relatedWebView;
591 }
592
593 - (WKWebView *)_alternateWebViewForNavigationGestures
594 {
595     return _alternateWebViewForNavigationGestures.getAutoreleased();
596 }
597
598 - (void)_setAlternateWebViewForNavigationGestures:(WKWebView *)alternateView
599 {
600     _alternateWebViewForNavigationGestures = alternateView;
601 }
602
603 - (NSString *)_groupIdentifier
604 {
605     return _groupIdentifier.get();
606 }
607
608 - (void)_setGroupIdentifier:(NSString *)groupIdentifier
609 {
610     _groupIdentifier = groupIdentifier;
611 }
612
613 - (BOOL)_treatsSHA1SignedCertificatesAsInsecure
614 {
615     return _pageConfiguration->treatsSHA1SignedCertificatesAsInsecure();
616 }
617
618 - (void)_setTreatsSHA1SignedCertificatesAsInsecure:(BOOL)insecure
619 {
620     _pageConfiguration->setTreatsSHA1SignedCertificatesAsInsecure(insecure);
621 }
622
623 - (BOOL)_respectsImageOrientation
624 {
625     return _respectsImageOrientation;
626 }
627
628 - (void)_setRespectsImageOrientation:(BOOL)respectsImageOrientation
629 {
630     _respectsImageOrientation = respectsImageOrientation;
631 }
632
633 - (BOOL)_printsBackgrounds
634 {
635     return _printsBackgrounds;
636 }
637
638 - (void)_setPrintsBackgrounds:(BOOL)printsBackgrounds
639 {
640     _printsBackgrounds = printsBackgrounds;
641 }
642
643 - (NSTimeInterval)_incrementalRenderingSuppressionTimeout
644 {
645     return _incrementalRenderingSuppressionTimeout;
646 }
647
648 - (void)_setIncrementalRenderingSuppressionTimeout:(NSTimeInterval)incrementalRenderingSuppressionTimeout
649 {
650     _incrementalRenderingSuppressionTimeout = incrementalRenderingSuppressionTimeout;
651 }
652
653 - (BOOL)_allowsJavaScriptMarkup
654 {
655     return _allowsJavaScriptMarkup;
656 }
657
658 - (void)_setAllowsJavaScriptMarkup:(BOOL)allowsJavaScriptMarkup
659 {
660     _allowsJavaScriptMarkup = allowsJavaScriptMarkup;
661 }
662
663 - (BOOL)_allowUniversalAccessFromFileURLs
664 {
665     return _allowUniversalAccessFromFileURLs;
666 }
667
668 - (void)_setAllowUniversalAccessFromFileURLs:(BOOL)allowUniversalAccessFromFileURLs
669 {
670     _allowUniversalAccessFromFileURLs = allowUniversalAccessFromFileURLs;
671 }
672
673 - (BOOL)_convertsPositionStyleOnCopy
674 {
675     return _convertsPositionStyleOnCopy;
676 }
677
678 - (void)_setConvertsPositionStyleOnCopy:(BOOL)convertsPositionStyleOnCopy
679 {
680     _convertsPositionStyleOnCopy = convertsPositionStyleOnCopy;
681 }
682
683 - (BOOL)_allowsMetaRefresh
684 {
685     return _allowsMetaRefresh;
686 }
687
688 - (void)_setAllowsMetaRefresh:(BOOL)allowsMetaRefresh
689 {
690     _allowsMetaRefresh = allowsMetaRefresh;
691 }
692
693 #if PLATFORM(IOS_FAMILY)
694 - (BOOL)_alwaysRunsAtForegroundPriority
695 {
696     return _pageConfiguration->alwaysRunsAtForegroundPriority();
697 }
698
699 - (void)_setAlwaysRunsAtForegroundPriority:(BOOL)alwaysRunsAtForegroundPriority
700 {
701     _pageConfiguration->setAlwaysRunsAtForegroundPriority(alwaysRunsAtForegroundPriority);
702 }
703
704 - (BOOL)_inlineMediaPlaybackRequiresPlaysInlineAttribute
705 {
706     return _inlineMediaPlaybackRequiresPlaysInlineAttribute;
707 }
708
709 - (void)_setInlineMediaPlaybackRequiresPlaysInlineAttribute:(BOOL)requires
710 {
711     _inlineMediaPlaybackRequiresPlaysInlineAttribute = requires;
712 }
713
714 - (BOOL)_allowsInlineMediaPlaybackAfterFullscreen
715 {
716     return _allowsInlineMediaPlaybackAfterFullscreen;
717 }
718
719 - (void)_setAllowsInlineMediaPlaybackAfterFullscreen:(BOOL)allows
720 {
721     _allowsInlineMediaPlaybackAfterFullscreen = allows;
722 }
723
724 - (_WKDragLiftDelay)_dragLiftDelay
725 {
726     return _dragLiftDelay;
727 }
728
729 - (void)_setDragLiftDelay:(_WKDragLiftDelay)dragLiftDelay
730 {
731     _dragLiftDelay = dragLiftDelay;
732 }
733
734 - (BOOL)_textInteractionGesturesEnabled
735 {
736     return _textInteractionGesturesEnabled;
737 }
738
739 - (void)_setTextInteractionGesturesEnabled:(BOOL)enabled
740 {
741     _textInteractionGesturesEnabled = enabled;
742 }
743
744 - (BOOL)_longPressActionsEnabled
745 {
746     return _longPressActionsEnabled;
747 }
748
749 - (void)_setLongPressActionsEnabled:(BOOL)enabled
750 {
751     _longPressActionsEnabled = enabled;
752 }
753
754 - (BOOL)_systemPreviewEnabled
755 {
756     return _systemPreviewEnabled;
757 }
758
759 - (void)_setSystemPreviewEnabled:(BOOL)enabled
760 {
761     _systemPreviewEnabled = enabled;
762 }
763
764 - (BOOL)_shouldDecidePolicyBeforeLoadingQuickLookPreview
765 {
766     return _shouldDecidePolicyBeforeLoadingQuickLookPreview;
767 }
768
769 - (void)_setShouldDecidePolicyBeforeLoadingQuickLookPreview:(BOOL)shouldDecide
770 {
771     _shouldDecidePolicyBeforeLoadingQuickLookPreview = shouldDecide;
772 }
773
774 #endif // PLATFORM(IOS_FAMILY)
775
776 - (BOOL)_invisibleAutoplayNotPermitted
777 {
778     return _invisibleAutoplayNotPermitted;
779 }
780
781 - (void)_setInvisibleAutoplayNotPermitted:(BOOL)notPermitted
782 {
783     _invisibleAutoplayNotPermitted = notPermitted;
784 }
785
786 - (BOOL)_mediaDataLoadsAutomatically
787 {
788     return _mediaDataLoadsAutomatically;
789 }
790
791 - (void)_setMediaDataLoadsAutomatically:(BOOL)mediaDataLoadsAutomatically
792 {
793     _mediaDataLoadsAutomatically = mediaDataLoadsAutomatically;
794 }
795
796 - (BOOL)_attachmentElementEnabled
797 {
798     return _attachmentElementEnabled;
799 }
800
801 - (void)_setAttachmentElementEnabled:(BOOL)attachmentElementEnabled
802 {
803     _attachmentElementEnabled = attachmentElementEnabled;
804 }
805
806 - (Class)_attachmentFileWrapperClass
807 {
808     return _attachmentFileWrapperClass;
809 }
810
811 - (void)_setAttachmentFileWrapperClass:(Class)attachmentFileWrapperClass
812 {
813     if (attachmentFileWrapperClass && ![attachmentFileWrapperClass isSubclassOfClass:[NSFileWrapper self]])
814         [NSException raise:NSInvalidArgumentException format:@"Class %@ does not inherit from NSFileWrapper", attachmentFileWrapperClass];
815
816     _attachmentFileWrapperClass = attachmentFileWrapperClass;
817 }
818
819 - (BOOL)_colorFilterEnabled
820 {
821     return _colorFilterEnabled;
822 }
823
824 - (void)_setColorFilterEnabled:(BOOL)colorFilterEnabled
825 {
826     _colorFilterEnabled = colorFilterEnabled;
827 }
828
829 - (BOOL)_incompleteImageBorderEnabled
830 {
831     return _incompleteImageBorderEnabled;
832 }
833
834 - (void)_setIncompleteImageBorderEnabled:(BOOL)incompleteImageBorderEnabled
835 {
836     _incompleteImageBorderEnabled = incompleteImageBorderEnabled;
837 }
838
839 - (BOOL)_shouldDeferAsynchronousScriptsUntilAfterDocumentLoad
840 {
841     return _shouldDeferAsynchronousScriptsUntilAfterDocumentLoad;
842 }
843
844 - (void)_setShouldDeferAsynchronousScriptsUntilAfterDocumentLoad:(BOOL)shouldDeferAsynchronousScriptsUntilAfterDocumentLoad
845 {
846     _shouldDeferAsynchronousScriptsUntilAfterDocumentLoad = shouldDeferAsynchronousScriptsUntilAfterDocumentLoad;
847 }
848
849 - (BOOL)_drawsBackground
850 {
851     return _drawsBackground;
852 }
853
854 - (void)_setDrawsBackground:(BOOL)drawsBackground
855 {
856     _drawsBackground = drawsBackground;
857 }
858
859 - (BOOL)_requiresUserActionForVideoPlayback
860 {
861     return self.mediaTypesRequiringUserActionForPlayback & WKAudiovisualMediaTypeVideo;
862 }
863
864 - (void)_setRequiresUserActionForVideoPlayback:(BOOL)requiresUserActionForVideoPlayback
865 {
866     if (requiresUserActionForVideoPlayback)
867         self.mediaTypesRequiringUserActionForPlayback |= WKAudiovisualMediaTypeVideo;
868     else
869         self.mediaTypesRequiringUserActionForPlayback &= ~WKAudiovisualMediaTypeVideo;
870 }
871
872 - (BOOL)_requiresUserActionForAudioPlayback
873 {
874     return self.mediaTypesRequiringUserActionForPlayback & WKAudiovisualMediaTypeAudio;
875 }
876
877 - (void)_setRequiresUserActionForAudioPlayback:(BOOL)requiresUserActionForAudioPlayback
878 {
879     if (requiresUserActionForAudioPlayback)
880         self.mediaTypesRequiringUserActionForPlayback |= WKAudiovisualMediaTypeAudio;
881     else
882         self.mediaTypesRequiringUserActionForPlayback &= ~WKAudiovisualMediaTypeAudio;
883 }
884
885 - (BOOL)_mainContentUserGestureOverrideEnabled
886 {
887     return _mainContentUserGestureOverrideEnabled;
888 }
889
890 - (void)_setMainContentUserGestureOverrideEnabled:(BOOL)mainContentUserGestureOverrideEnabled
891 {
892     _mainContentUserGestureOverrideEnabled = mainContentUserGestureOverrideEnabled;
893 }
894
895 - (BOOL)_initialCapitalizationEnabled
896 {
897     return _pageConfiguration->initialCapitalizationEnabled();
898 }
899
900 - (void)_setInitialCapitalizationEnabled:(BOOL)initialCapitalizationEnabled
901 {
902     _pageConfiguration->setInitialCapitalizationEnabled(initialCapitalizationEnabled);
903 }
904
905 - (BOOL)_waitsForPaintAfterViewDidMoveToWindow
906 {
907     return _waitsForPaintAfterViewDidMoveToWindow;
908 }
909
910 - (void)_setWaitsForPaintAfterViewDidMoveToWindow:(BOOL)shouldSynchronize
911 {
912     _waitsForPaintAfterViewDidMoveToWindow = shouldSynchronize;
913 }
914
915 - (BOOL)_isControlledByAutomation
916 {
917     return _controlledByAutomation;
918 }
919
920 - (void)_setControlledByAutomation:(BOOL)controlledByAutomation
921 {
922     _controlledByAutomation = controlledByAutomation;
923 }
924
925 - (_WKApplicationManifest *)_applicationManifest
926 {
927     return wrapper(_pageConfiguration->applicationManifest());
928 }
929
930 - (void)_setApplicationManifest:(_WKApplicationManifest *)applicationManifest
931 {
932     _pageConfiguration->setApplicationManifest(applicationManifest ? applicationManifest->_applicationManifest.get() : nullptr);
933 }
934
935 #if PLATFORM(MAC)
936 - (BOOL)_showsURLsInToolTips
937 {
938     return _showsURLsInToolTips;
939 }
940
941 - (void)_setShowsURLsInToolTips:(BOOL)showsURLsInToolTips
942 {
943     _showsURLsInToolTips = showsURLsInToolTips;
944 }
945
946 - (BOOL)_serviceControlsEnabled
947 {
948     return _serviceControlsEnabled;
949 }
950
951 - (void)_setServiceControlsEnabled:(BOOL)serviceControlsEnabled
952 {
953     _serviceControlsEnabled = serviceControlsEnabled;
954 }
955
956 - (BOOL)_imageControlsEnabled
957 {
958     return _imageControlsEnabled;
959 }
960
961 - (void)_setImageControlsEnabled:(BOOL)imageControlsEnabled
962 {
963     _imageControlsEnabled = imageControlsEnabled;
964 }
965
966 - (BOOL)_requiresUserActionForEditingControlsManager
967 {
968     return _requiresUserActionForEditingControlsManager;
969 }
970
971 - (void)_setRequiresUserActionForEditingControlsManager:(BOOL)requiresUserAction
972 {
973     _requiresUserActionForEditingControlsManager = requiresUserAction;
974 }
975
976 - (WKPageGroupRef)_pageGroup
977 {
978     return _pageGroup.get();
979 }
980
981 - (void)_setPageGroup:(WKPageGroupRef)pageGroup
982 {
983     _pageGroup = pageGroup;
984 }
985
986 - (void)_setCPULimit:(double)cpuLimit
987 {
988     _pageConfiguration->setCPULimit(cpuLimit);
989 }
990
991 - (double)_cpuLimit
992 {
993     return _pageConfiguration->cpuLimit().valueOr(0);
994 }
995
996 #endif // PLATFORM(MAC)
997
998 - (BOOL)_applePayEnabled
999 {
1000 #if ENABLE(APPLE_PAY)
1001     return _applePayEnabled;
1002 #else
1003     return NO;
1004 #endif
1005 }
1006
1007 - (void)_setApplePayEnabled:(BOOL)applePayEnabled
1008 {
1009 #if ENABLE(APPLE_PAY)
1010     _applePayEnabled = applePayEnabled;
1011 #endif
1012 }
1013
1014 - (BOOL)_needsStorageAccessFromFileURLsQuirk
1015 {
1016     return _needsStorageAccessFromFileURLsQuirk;
1017 }
1018
1019 - (void)_setNeedsStorageAccessFromFileURLsQuirk:(BOOL)needsLocalStorageQuirk
1020 {
1021     _needsStorageAccessFromFileURLsQuirk = needsLocalStorageQuirk;
1022 }
1023
1024 - (NSString *)_overrideContentSecurityPolicy
1025 {
1026     return _pageConfiguration->overrideContentSecurityPolicy();
1027 }
1028
1029 - (void)_setOverrideContentSecurityPolicy:(NSString *)overrideContentSecurityPolicy
1030 {
1031     _pageConfiguration->setOverrideContentSecurityPolicy(overrideContentSecurityPolicy);
1032 }
1033
1034 - (NSString *)_mediaContentTypesRequiringHardwareSupport
1035 {
1036     return _mediaContentTypesRequiringHardwareSupport.get();
1037 }
1038
1039 - (void)_setMediaContentTypesRequiringHardwareSupport:(NSString *)mediaContentTypesRequiringHardwareSupport
1040 {
1041     _mediaContentTypesRequiringHardwareSupport = adoptNS([mediaContentTypesRequiringHardwareSupport copy]);
1042 }
1043
1044 - (NSArray<NSString *> *)_additionalSupportedImageTypes
1045 {
1046     return _additionalSupportedImageTypes.get();
1047 }
1048
1049 - (void)_setAdditionalSupportedImageTypes:(NSArray<NSString *> *)additionalSupportedImageTypes
1050 {
1051     _additionalSupportedImageTypes = adoptNS([additionalSupportedImageTypes copy]);
1052 }
1053
1054 - (void)_setLegacyEncryptedMediaAPIEnabled:(BOOL)enabled
1055 {
1056     _legacyEncryptedMediaAPIEnabled = enabled;
1057 }
1058
1059 - (BOOL)_legacyEncryptedMediaAPIEnabled
1060 {
1061     return _legacyEncryptedMediaAPIEnabled;
1062 }
1063
1064 - (void)_setAllowMediaContentTypesRequiringHardwareSupportAsFallback:(BOOL)allow
1065 {
1066     _allowMediaContentTypesRequiringHardwareSupportAsFallback = allow;
1067 }
1068
1069 - (BOOL)_allowMediaContentTypesRequiringHardwareSupportAsFallback
1070 {
1071     return _allowMediaContentTypesRequiringHardwareSupportAsFallback;
1072 }
1073
1074 - (void)_setEditableImagesEnabled:(BOOL)enabled
1075 {
1076     _editableImagesEnabled = enabled;
1077 }
1078
1079 - (BOOL)_editableImagesEnabled
1080 {
1081     return _editableImagesEnabled;
1082 }
1083
1084 - (void)_setUndoManagerAPIEnabled:(BOOL)enabled
1085 {
1086     _undoManagerAPIEnabled = enabled;
1087 }
1088
1089 - (BOOL)_undoManagerAPIEnabled
1090 {
1091     return _undoManagerAPIEnabled;
1092 }
1093
1094 @end
1095
1096 @implementation WKWebViewConfiguration (WKDeprecated)
1097
1098 #if PLATFORM(IOS_FAMILY)
1099 - (BOOL)mediaPlaybackAllowsAirPlay
1100 {
1101     return self.allowsAirPlayForMediaPlayback;
1102 }
1103
1104 - (void)setMediaPlaybackAllowsAirPlay:(BOOL)allowed
1105 {
1106     self.allowsAirPlayForMediaPlayback = allowed;
1107 }
1108
1109 - (BOOL)mediaPlaybackRequiresUserAction
1110 {
1111     return self.requiresUserActionForMediaPlayback;
1112 }
1113
1114 - (void)setMediaPlaybackRequiresUserAction:(BOOL)required
1115 {
1116     self.requiresUserActionForMediaPlayback = required;
1117 }
1118
1119 - (BOOL)requiresUserActionForMediaPlayback
1120 {
1121     return self.mediaTypesRequiringUserActionForPlayback == WKAudiovisualMediaTypeAll;
1122 }
1123
1124 - (void)setRequiresUserActionForMediaPlayback:(BOOL)requiresUserActionForMediaPlayback
1125 {
1126     self.mediaTypesRequiringUserActionForPlayback = requiresUserActionForMediaPlayback ? WKAudiovisualMediaTypeAll : WKAudiovisualMediaTypeNone;
1127 }
1128
1129 #endif // PLATFORM(IOS_FAMILY)
1130
1131 @end
1132
1133 @implementation WKWebViewConfiguration (WKBinaryCompatibilityWithIOS10)
1134
1135 -(_WKVisitedLinkStore *)_visitedLinkProvider
1136 {
1137     return self._visitedLinkStore;
1138 }
1139
1140 - (void)_setVisitedLinkProvider:(_WKVisitedLinkStore *)visitedLinkProvider
1141 {
1142     self._visitedLinkStore = visitedLinkProvider;
1143 }
1144
1145 @end