Skip to content

Commit

Permalink
Add run-time flag for in-app browser privacy
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=205288
<rdar://problem/57569206>

Reviewed by John Wilander.

Source/WebCore:

* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setInAppBrowserPrivacyEnabled):
(WebCore::RuntimeEnabledFeatures::isInAppBrowserPrivacyEnabled const):
* page/Settings.yaml:

Source/WebKit:

* Shared/WebPreferences.yaml:

Source/WebKitLegacy/mac:

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences isInAppBrowserPrivacyEnabled]):
(-[WebPreferences setInAppBrowserPrivacyEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@253655 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
[email protected] committed Dec 17, 2019
1 parent adc7611 commit f93530c
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Source/WebCore/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
2019-12-17 Kate Cheney <[email protected]>

Add run-time flag for in-app browser privacy
https://bugs.webkit.org/show_bug.cgi?id=205288
<rdar://problem/57569206>

Reviewed by John Wilander.

* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setInAppBrowserPrivacyEnabled):
(WebCore::RuntimeEnabledFeatures::isInAppBrowserPrivacyEnabled const):
* page/Settings.yaml:

2019-12-17 Ryosuke Niwa <[email protected]>

executeIfJavaScriptURL should check requester's security origin
Expand Down
5 changes: 5 additions & 0 deletions Source/WebCore/page/RuntimeEnabledFeatures.h
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,9 @@ class RuntimeEnabledFeatures {
bool secureContextChecksEnabled() const { return m_secureContextChecksEnabled; }
void setSecureContextChecksEnabled(bool isEnabled) { m_secureContextChecksEnabled = isEnabled; }

void setIsInAppBrowserPrivacyEnabled(bool isEnabled) { m_isInAppBrowserPrivacyEnabled = isEnabled; }
bool isInAppBrowserPrivacyEnabled() const { return m_isInAppBrowserPrivacyEnabled; }

private:
// Never instantiate.
RuntimeEnabledFeatures();
Expand Down Expand Up @@ -584,6 +587,8 @@ class RuntimeEnabledFeatures {
bool m_secureContextChecksEnabled { true };
bool m_isCSSShadowPartsEnabled { true };

bool m_isInAppBrowserPrivacyEnabled { false };

friend class WTF::NeverDestroyed<RuntimeEnabledFeatures>;
};

Expand Down
3 changes: 3 additions & 0 deletions Source/WebCore/page/Settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,9 @@ legacyGetUserMediaEnabled:
initial: false
conditional: MEDIA_STREAM

isInAppBrowserPrivacyEnabled:
initial: false

# Deprecated

iceCandidateFilteringEnabled:
Expand Down
10 changes: 10 additions & 0 deletions Source/WebKit/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
2019-12-17 Kate Cheney <[email protected]>

Add run-time flag for in-app browser privacy
https://bugs.webkit.org/show_bug.cgi?id=205288
<rdar://problem/57569206>

Reviewed by John Wilander.

* Shared/WebPreferences.yaml:

2019-12-17 Ben Nham <[email protected]>

Navigation from empty page doesn't use cached web process
Expand Down
8 changes: 8 additions & 0 deletions Source/WebKit/Shared/WebPreferences.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1877,6 +1877,14 @@ UseGPUProcessForMedia:
category: internal
webcoreName: useGPUProcessForMedia

IsInAppBrowserPrivacyEnabled:
type: bool
defaultValue: true
humanReadableName: "In-App Browser Privacy"
humanReadableDescription: "Enable In-App Browser Privacy"
webcoreBinding: RuntimeEnabledFeatures
category: internal

# Deprecated

ICECandidateFilteringEnabled:
Expand Down
17 changes: 17 additions & 0 deletions Source/WebKitLegacy/mac/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
2019-12-17 Kate Cheney <[email protected]>

Add run-time flag for in-app browser privacy
https://bugs.webkit.org/show_bug.cgi?id=205288
<rdar://problem/57569206>

Reviewed by John Wilander.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences isInAppBrowserPrivacyEnabled]):
(-[WebPreferences setInAppBrowserPrivacyEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

2019-12-16 Simon Fraser <[email protected]>

Change 'delegatesPageScaling' from a Setting to a flag on ScrollView
Expand Down
1 change: 1 addition & 0 deletions Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,4 +280,5 @@
#define WebKitRequestIdleCallbackEnabledPreferenceKey @"WebKitRequestIdleCallbackEnabled"
#define WebKitAsyncClipboardAPIEnabledPreferenceKey @"WebKitAsyncClipboardAPIEnabled"
#define WebKitLinkPreloadResponsiveImagesEnabledPreferenceKey @"WebKitLinkPreloadResponsiveImagesEnabled"
#define WebKitInAppBrowserPrivacyEnabledPreferenceKey @"WebKitInAppBrowserPrivacyEnabled"

12 changes: 12 additions & 0 deletions Source/WebKitLegacy/mac/WebView/WebPreferences.mm
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,7 @@ + (void)initialize
@NO, WebKitAsyncClipboardAPIEnabledPreferenceKey,
@NO, WebKitLinkPreloadResponsiveImagesEnabledPreferenceKey,
@YES, WebKitCSSShadowPartsEnabledPreferenceKey,
@NO, WebKitInAppBrowserPrivacyEnabledPreferenceKey,
nil];

#if !PLATFORM(IOS_FAMILY)
Expand Down Expand Up @@ -3601,6 +3602,17 @@ - (void)setRemotePlaybackEnabled:(BOOL)remotePlaybackEnabled
{
[self _setBoolValue:remotePlaybackEnabled forKey:WebKitRemotePlaybackEnabledPreferenceKey];
}

- (BOOL)isInAppBrowserPrivacyEnabled
{
return [self _boolValueForKey:WebKitInAppBrowserPrivacyEnabledPreferenceKey];
}

- (void)setInAppBrowserPrivacyEnabled:(BOOL)flag
{
[self _setBoolValue:flag forKey:WebKitInAppBrowserPrivacyEnabledPreferenceKey];
}

@end

@implementation WebPreferences (WebInternal)
Expand Down
3 changes: 3 additions & 0 deletions Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,9 @@ extern NSString *WebPreferencesCacheModelChangedInternalNotification WEBKIT_DEPR
- (void)setCSSShadowPartsEnabled:(BOOL)flag;
- (BOOL)cssShadowPartsEnabled;

- (BOOL)isInAppBrowserPrivacyEnabled;
- (void)setInAppBrowserPrivacyEnabled:(BOOL)flag;

@property (nonatomic) BOOL visualViewportAPIEnabled;
@property (nonatomic) BOOL CSSOMViewScrollingAPIEnabled;
@property (nonatomic) BOOL largeImageAsyncDecodingEnabled;
Expand Down
1 change: 1 addition & 0 deletions Source/WebKitLegacy/mac/WebView/WebView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -3192,6 +3192,7 @@ - (void)_preferencesChanged:(WebPreferences *)preferences
RuntimeEnabledFeatures::sharedFeatures().setDialogElementEnabled([preferences dialogElementEnabled]);
RuntimeEnabledFeatures::sharedFeatures().setKeygenElementEnabled([preferences keygenElementEnabled]);
RuntimeEnabledFeatures::sharedFeatures().setCSSShadowPartsEnabled([preferences cssShadowPartsEnabled]);
RuntimeEnabledFeatures::sharedFeatures().setIsInAppBrowserPrivacyEnabled([preferences isInAppBrowserPrivacyEnabled]);

#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
RuntimeEnabledFeatures::sharedFeatures().setLegacyEncryptedMediaAPIEnabled(preferences.legacyEncryptedMediaAPIEnabled);
Expand Down

0 comments on commit f93530c

Please sign in to comment.