diff options
| author | Shokara Kou <kou@13f0.net> | 2022-06-08 08:41:15 -0400 |
|---|---|---|
| committer | Shokara Kou <kou@13f0.net> | 2022-06-08 08:41:15 -0400 |
| commit | 2be1931967e4073a55d7ac3e3ecdff7c825a63f4 (patch) | |
| tree | fbccd4a9f89d535835c1cb711c3c36d03baee871 /www/chromium-uc/patches/extra/ungoogled-chromium/add-flag-to-change-http-accept-header.patch | |
| parent | 312b6669fd956f3e97dd005c1441152fb4e568ec (diff) | |
update ugc to 102.0.5005.61-3
Diffstat (limited to 'www/chromium-uc/patches/extra/ungoogled-chromium/add-flag-to-change-http-accept-header.patch')
| -rw-r--r-- | www/chromium-uc/patches/extra/ungoogled-chromium/add-flag-to-change-http-accept-header.patch | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/www/chromium-uc/patches/extra/ungoogled-chromium/add-flag-to-change-http-accept-header.patch b/www/chromium-uc/patches/extra/ungoogled-chromium/add-flag-to-change-http-accept-header.patch new file mode 100644 index 0000000..ede83e7 --- /dev/null +++ b/www/chromium-uc/patches/extra/ungoogled-chromium/add-flag-to-change-http-accept-header.patch | |||
| @@ -0,0 +1,49 @@ | |||
| 1 | --- a/chrome/browser/ungoogled_flag_entries.h | ||
| 2 | +++ b/chrome/browser/ungoogled_flag_entries.h | ||
| 3 | @@ -96,4 +96,8 @@ | ||
| 4 | "Disable GREASE for TLS", | ||
| 5 | "Turn off GREASE (Generate Random Extensions And Sustain Extensibility) for TLS connections. ungoogled-chromium flag.", | ||
| 6 | kOsAll, SINGLE_VALUE_TYPE("disable-grease-tls")}, | ||
| 7 | + {"http-accept-header", | ||
| 8 | + "Custom HTTP Accept Header", | ||
| 9 | + "Set a custom value for the Accept header which is sent by the browser with every HTTP request. (e.g. `text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8`). ungoogled-chromium flag.", | ||
| 10 | + kOsAll, ORIGIN_LIST_VALUE_TYPE("http-accept-header", "")}, | ||
| 11 | #endif // CHROME_BROWSER_UNGOOGLED_FLAG_ENTRIES_H_ | ||
| 12 | --- a/components/flags_ui/flags_state.cc | ||
| 13 | +++ b/components/flags_ui/flags_state.cc | ||
| 14 | @@ -209,6 +209,7 @@ std::string GetCombinedOriginListValue(c | ||
| 15 | const std::string new_value = | ||
| 16 | flags_storage.GetOriginListFlag(internal_entry_name); | ||
| 17 | if (command_line_switch == "custom-ntp") return existing_value.empty() ? new_value : existing_value; | ||
| 18 | + if (command_line_switch == "http-accept-header") return existing_value.empty() ? new_value : existing_value; | ||
| 19 | return CombineAndSanitizeOriginLists(existing_value, new_value); | ||
| 20 | } | ||
| 21 | |||
| 22 | @@ -398,6 +399,7 @@ void FlagsState::SetOriginListFlag(const | ||
| 23 | FlagsStorage* flags_storage) { | ||
| 24 | const std::string new_value = | ||
| 25 | internal_name == "custom-ntp" ? value : | ||
| 26 | + internal_name == "http-accept-header" ? value : | ||
| 27 | CombineAndSanitizeOriginLists(std::string(), value); | ||
| 28 | flags_storage->SetOriginListFlag(internal_name, new_value); | ||
| 29 | |||
| 30 | --- a/content/public/browser/frame_accept_header.cc | ||
| 31 | +++ b/content/public/browser/frame_accept_header.cc | ||
| 32 | @@ -4,6 +4,7 @@ | ||
| 33 | |||
| 34 | #include "content/public/browser/frame_accept_header.h" | ||
| 35 | |||
| 36 | +#include "base/command_line.h" | ||
| 37 | #include "content/browser/web_package/signed_exchange_consts.h" | ||
| 38 | #include "content/browser/web_package/signed_exchange_utils.h" | ||
| 39 | #include "content/common/content_constants_internal.h" | ||
| 40 | @@ -14,6 +15,9 @@ namespace content { | ||
| 41 | |||
| 42 | std::string FrameAcceptHeaderValue(bool allow_sxg_responses, | ||
| 43 | BrowserContext* browser_context) { | ||
| 44 | + if (base::CommandLine::ForCurrentProcess()->HasSwitch("http-accept-header")) | ||
| 45 | + return base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII("http-accept-header"); | ||
| 46 | + | ||
| 47 | std::string header_value = kFrameAcceptHeaderValue; | ||
| 48 | |||
| 49 | #if BUILDFLAG(ENABLE_JXL_DECODER) | ||
