Skip to content
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

A different approach to chromium accepting my responses #3

Merged
merged 1 commit into from
Feb 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions component/rest_of_chromium.patch
Original file line number Diff line number Diff line change
Expand Up @@ -142,18 +142,20 @@ index febbb4791f6a2..7e4b1153213fe 100644
#if BUILDFLAG(ENABLE_OFFLINE_PAGES)
interceptors.push_back(
std::make_unique<offline_pages::OfflinePageURLLoaderRequestInterceptor>(
diff --git a/content/browser/renderer_host/navigation_request.cc b/content/browser/renderer_host/navigation_request.cc
index d66761d9e1030..ffd9e852f86e9 100644
--- a/content/browser/renderer_host/navigation_request.cc
+++ b/content/browser/renderer_host/navigation_request.cc
@@ -872,7 +872,9 @@ GetOriginForURLLoaderFactoryUncheckedWithDebugInfo(
url::Origin::Create(navigation_request->GetWebBundleURL())),
"web_bundle");
}
-
+ if (common_params.url.SchemeIs("ipfs") || common_params.url.SchemeIs("ipns")) {
+ return std::make_pair(url::Origin::Create(common_params.url), "ca_uri");
diff --git a/chrome/common/chrome_content_client.cc b/chrome/common/chrome_content_client.cc
index db08f6151229e..e63c004ec6398 100644
--- a/chrome/common/chrome_content_client.cc
+++ b/chrome/common/chrome_content_client.cc
@@ -292,6 +292,12 @@ void ChromeContentClient::AddAdditionalSchemes(Schemes* schemes) {
#if BUILDFLAG(IS_ANDROID)
schemes->local_schemes.push_back(url::kContentScheme);
#endif
+ for ( const char* ip_s : {"ipfs", "ipns"} ) {
+ schemes->standard_schemes.push_back(ip_s);
+ schemes->cors_enabled_schemes.push_back(ip_s);
+ schemes->secure_schemes.push_back(ip_s);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could also be worth questioning how many of these categories IPFS/IPNS really need to be in.

For my purposes I'm pretty sure they need to be in standard_schemes at the very least.

If they're in secure_schemes, then perhaps we have to ban insecure http gateways (or maybe just non-localhost http?). FWIW, right now I don't believe I have any in the list anyhow.

+ schemes->csp_bypassing_schemes.push_back(ip_s);
+ }
// In cases not covered above, URLLoaderFactory should be associated with the
// origin of |common_params.url| and/or |common_params.initiator_origin|.
return std::make_pair(
}

std::u16string ChromeContentClient::GetLocalizedString(int message_id) {