-
-
Notifications
You must be signed in to change notification settings - Fork 18
feat: Exposed Preferences #113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
4f1048b
feat: add preferences for various features
RKNF404 8ab6913
feat: disable 3D APIs by default
RKNF404 1a9922d
fix: patch application rejection
RKNF404 249818d
fix: reference code residue
RKNF404 9f9ee9b
fix: HTML formatting
RKNF404 12097c5
fix: broken patch adjustments
RKNF404 9d94592
fix: formatting and functionality adjustments
RKNF404 e89870f
chore: syntax adjustments
RKNF404 6c32908
fix: TS build error and re-place HTML toggles
RKNF404 a0dd367
fix: various visual improvements
RKNF404 379bbe8
fix: add clarification to UI
RKNF404 a493063
chore: re-order prefs
RKNF404 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc | ||
| index bfbdf8fcc8fa0..fac996b413b3f 100644 | ||
| --- a/chrome/browser/chrome_content_browser_client.cc | ||
| +++ b/chrome/browser/chrome_content_browser_client.cc | ||
| @@ -1581,7 +1581,7 @@ void ChromeContentBrowserClient::RegisterLocalStatePrefs( | ||
| // static | ||
| void ChromeContentBrowserClient::RegisterProfilePrefs( | ||
| user_prefs::PrefRegistrySyncable* registry) { | ||
| - registry->RegisterBooleanPref(prefs::kDisable3DAPIs, false); | ||
| + registry->RegisterBooleanPref(prefs::kDisable3DAPIs, true); | ||
| registry->RegisterBooleanPref(prefs::kEnableHyperlinkAuditing, false); | ||
| // Register user prefs for mapping SitePerProcess and IsolateOrigins in | ||
| // user policy in addition to the same named ones in Local State (which are |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| diff --git a/chrome/browser/extensions/api/settings_private/prefs_util.cc b/chrome/browser/extensions/api/settings_private/prefs_util.cc | ||
| index 9be2589cac759..be53fe96dd397 100644 | ||
| --- a/chrome/browser/extensions/api/settings_private/prefs_util.cc | ||
| +++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc | ||
| @@ -172,6 +172,16 @@ const PrefsUtil::TypedPrefMap& PrefsUtil::GetAllowlistedKeys() { | ||
| } | ||
| s_allowlist = new PrefsUtil::TypedPrefMap(); | ||
|
|
||
| + // hardened-chromium | ||
| + (*s_allowlist)[::prefs::kWebRTCIPHandlingPolicy] = | ||
| + settings_api::PrefType::kString; | ||
| + (*s_allowlist)[::prefs::kDisable3DAPIs] = | ||
| + settings_api::PrefType::kBoolean; | ||
| + (*s_allowlist)[::prefs::kWebKitForceDarkModeEnabled] = | ||
| + settings_api::PrefType::kBoolean; | ||
| + (*s_allowlist)[::prefs::kDisableExtensions] = | ||
| + settings_api::PrefType::kBoolean; | ||
| + | ||
| // Miscellaneous | ||
| (*s_allowlist)[::embedder_support::kAlternateErrorPagesEnabled] = | ||
| settings_api::PrefType::kBoolean; | ||
| diff --git a/chrome/browser/resources/settings/appearance_page/appearance_page.html b/chrome/browser/resources/settings/appearance_page/appearance_page.html | ||
| index 47120511edffd..53f2330898dd9 100644 | ||
| --- a/chrome/browser/resources/settings/appearance_page/appearance_page.html | ||
| +++ b/chrome/browser/resources/settings/appearance_page/appearance_page.html | ||
| @@ -119,6 +119,11 @@ | ||
| </template> | ||
| </select> | ||
| </div> | ||
| + <div class="hr"></div> | ||
| + <settings-toggle-button | ||
| + pref="{{prefs.webkit.webprefs.force_dark_mode_enabled}}" | ||
| + label="Website Dark Mode"> | ||
| + </settings-toggle-button> | ||
| <div | ||
| class="hr" | ||
| hidden="[[!showHr_( | ||
| diff --git a/chrome/browser/resources/settings/privacy_page/security_page.html b/chrome/browser/resources/settings/privacy_page/security_page.html | ||
| index d54888d0e712f..2dbeb7b8b444b 100644 | ||
| --- a/chrome/browser/resources/settings/privacy_page/security_page.html | ||
| +++ b/chrome/browser/resources/settings/privacy_page/security_page.html | ||
| @@ -7,6 +7,9 @@ | ||
| padding: 0 var(--cr-section-padding); | ||
| } | ||
|
|
||
| + #webrtcLabel { | ||
| + flex: 1; | ||
| + } | ||
|
|
||
| .bullet-line { | ||
| align-items: center; | ||
| @@ -227,3 +230,27 @@ | ||
| on-click="onChromeCertificatesClick_"> | ||
| </cr-link-row> | ||
| </if> | ||
| + | ||
| + <div id="hardeningSection"> | ||
| + <div class="cr-row first"><h2 class="cr-title-text">Hardening</h2></div> | ||
| + <settings-toggle-button class="cr-row first" | ||
| + pref="{{prefs.disable_3d_apis}}" | ||
| + label="Disable 3D APIs" | ||
| + sub-label="Disable features like WebGL and Pepper 3D"> | ||
| + </settings-toggle-button> | ||
| + <div class="cr-row"> | ||
| + <div id="webrtcLabel" class="flex cr-padded-text" aria-hidden="true"> | ||
| + WebRTC Handling Policy | ||
| + </div> | ||
| + <settings-dropdown-menu | ||
| + label="WebRTC Handling Policy" | ||
| + pref="{{prefs.webrtc.ip_handling_policy}}" | ||
| + menu-options="[[webrtcHandlingPolicyOptions_]]"> | ||
| + </settings-dropdown-menu> | ||
| + </div> | ||
| + <settings-toggle-button class="cr-row" | ||
| + pref="{{prefs.extensions.disabled}}" | ||
| + label="Disable Extensions"> | ||
| + sub-label="Changes to this setting requires a restart"> | ||
| + </settings-toggle-button> | ||
| + </div> | ||
| diff --git a/chrome/browser/resources/settings/privacy_page/security_page.ts b/chrome/browser/resources/settings/privacy_page/security_page.ts | ||
| index b0371a95c7dbe..60857ef0ee296 100644 | ||
| --- a/chrome/browser/resources/settings/privacy_page/security_page.ts | ||
| +++ b/chrome/browser/resources/settings/privacy_page/security_page.ts | ||
| @@ -111,6 +111,19 @@ export class SettingsSecurityPageElement extends | ||
| }, | ||
| // </if> | ||
|
|
||
| + webrtcHandlingPolicyOptions_: { | ||
| + readOnly: true, | ||
| + type: Array, | ||
| + value() { | ||
| + return [ | ||
| + {value: "default", name: "Default"}, | ||
| + {value: "default_public_and_private_interfaces", name: "Default Public and Private Interfaces"}, | ||
| + {value: "default_public_interface_only", name: "Default Public Interface Only"}, | ||
| + {value: "disable_non_proxied_udp", name: "Disable Non-Proxied UDP"}, | ||
| + ]; | ||
| + }, | ||
| + }, | ||
| + | ||
| /** | ||
| * Whether the secure DNS setting should be displayed. | ||
| */ | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.