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

Unescape #119

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
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
28 changes: 0 additions & 28 deletions chromium_edits/124.0.6323.0/url/url_canon.h.patch

This file was deleted.

55 changes: 0 additions & 55 deletions chromium_edits/124.0.6323.0/url/url_canon_ipfs.cc

This file was deleted.

22 changes: 0 additions & 22 deletions chromium_edits/124.0.6323.0/url/url_util.cc.patch

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index 7c6e3dea2fa88..a7496359c413d 100644
index fe0452e8bd462..575137d6dbbf9 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -41,6 +41,7 @@ import("//sandbox/features.gni")
Expand All @@ -10,7 +10,7 @@ index 7c6e3dea2fa88..a7496359c413d 100644
import("//third_party/protobuf/proto_library.gni")
import("//third_party/webrtc/webrtc.gni")
import("//third_party/widevine/cdm/widevine.gni")
@@ -2721,6 +2722,14 @@ static_library("browser") {
@@ -2717,6 +2718,14 @@ static_library("browser") {
]
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index 97b604eed712a..187a2738cbfda 100644
index 96370d4ac35a9..82bf3f78caccc 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -220,6 +220,7 @@
Expand All @@ -21,7 +21,7 @@ index 97b604eed712a..187a2738cbfda 100644
#if BUILDFLAG(ENABLE_PDF)
#include "pdf/pdf_features.h"
#endif
@@ -10076,6 +10081,14 @@ const FeatureEntry kFeatureEntries[] = {
@@ -10130,6 +10135,14 @@ const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kOmitCorsClientCertDescription, kOsAll,
FEATURE_VALUE_TYPE(network::features::kOmitCorsClientCert)},

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index 4b8cf312d4ca4..c7345399b4908 100644
index c4b98aa0e759f..0b645f5482fca 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -396,6 +396,7 @@
Expand All @@ -24,7 +24,7 @@ index 4b8cf312d4ca4..c7345399b4908 100644
#if !BUILDFLAG(IS_ANDROID)
#include "chrome/browser/digital_credentials/digital_identity_provider_desktop.h"
#include "chrome/browser/preloading/preview/preview_navigation_throttle.h"
@@ -1862,6 +1870,11 @@ ChromeContentBrowserClient::CreateBrowserMainParts(bool is_integration_test) {
@@ -1870,6 +1878,11 @@ ChromeContentBrowserClient::CreateBrowserMainParts(bool is_integration_test) {
main_parts->AddParts(
std::make_unique<ChromeBrowserMainExtraPartsNaclDeprecation>());

Expand All @@ -36,7 +36,7 @@ index 4b8cf312d4ca4..c7345399b4908 100644
return main_parts;
}

@@ -6467,12 +6480,29 @@ void ChromeContentBrowserClient::
@@ -6482,12 +6495,29 @@ void ChromeContentBrowserClient::
const std::optional<url::Origin>& request_initiator_origin,
NonNetworkURLLoaderFactoryMap* factories) {
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(ENABLE_EXTENSIONS) || \
Expand Down Expand Up @@ -67,7 +67,7 @@ index 4b8cf312d4ca4..c7345399b4908 100644

#if BUILDFLAG(IS_CHROMEOS_ASH)
if (web_contents) {
@@ -6617,6 +6647,11 @@ ChromeContentBrowserClient::WillCreateURLLoaderRequestInterceptors(
@@ -6633,6 +6663,11 @@ ChromeContentBrowserClient::WillCreateURLLoaderRequestInterceptors(
scoped_refptr<base::SequencedTaskRunner> navigation_response_task_runner) {
std::vector<std::unique_ptr<content::URLLoaderRequestInterceptor>>
interceptors;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json
index 6671e383a0807..5279b7f2419e2 100644
index fa225f6564471..e8444d0f88e84 100644
--- a/chrome/browser/flag-metadata.json
+++ b/chrome/browser/flag-metadata.json
@@ -3376,6 +3376,11 @@
@@ -3386,6 +3386,11 @@
"owners": [ "[email protected]", "[email protected]" ],
"expiry_milestone": 130
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
index bda0400e3811d..5074f0a19e3eb 100644
index be5b3f2e79a5f..d61281fca8be5 100644
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -302,6 +302,11 @@ const char kEnableBenchmarkingChoiceDefaultFeatureStates[] =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
index 01ac19bf4fac5..3a304131016a1 100644
index b14d6612eaa86..34aa125a87e57 100644
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -24,6 +24,7 @@
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index 0f37944dfa465..1368cfdf9e02b 100644
index 8cf6b5d7d4281..699490b84fc37 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -199,6 +199,8 @@
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/chrome/browser/shell_integration_mac.mm b/chrome/browser/shell_integration_mac.mm
index c6bb768979453..c0d0abb9c78f3 100644
--- a/chrome/browser/shell_integration_mac.mm
+++ b/chrome/browser/shell_integration_mac.mm
@@ -79,6 +79,8 @@ bool SetAsDefaultBrowser() {
if (LSSetDefaultHandlerForURLScheme(CFSTR("https"), identifier) != noErr) {
return false;
}
+ LSSetDefaultHandlerForURLScheme(CFSTR("ipfs"), identifier);
+ LSSetDefaultHandlerForURLScheme(CFSTR("ipns"), identifier);
if (LSSetDefaultRoleHandlerForContentType(kUTTypeHTML, kLSRolesViewer,
identifier) != noErr) {
return false;
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/chrome/installer/linux/common/desktop.template b/chrome/installer/linux/common/desktop.template
index 2eb13ee1aba46..9af65726bde89 100644
--- a/chrome/installer/linux/common/desktop.template
+++ b/chrome/installer/linux/common/desktop.template
@@ -111,7 +111,7 @@ Terminal=false
Icon=@@PACKAGE@@
Type=Application
Categories=Network;WebBrowser;
-MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https;
+MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ipfs;x-scheme-handler/ipns;
Actions=new-window;new-private-window;

[Desktop Action new-window]
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc
index 87a2c70b6cb1a..50c52f1ef579e 100644
--- a/chrome/installer/util/shell_util.cc
+++ b/chrome/installer/util/shell_util.cc
@@ -1523,11 +1523,12 @@ const wchar_t* ShellUtil::kDefaultFileAssociations[] = {
const wchar_t* ShellUtil::kPotentialFileAssociations[] = {
L".htm", L".html", L".pdf", L".shtml", L".svg",
L".xht", L".xhtml", L".webp", nullptr};
-const wchar_t* ShellUtil::kBrowserProtocolAssociations[] = {L"http", L"https",
- nullptr};
+const wchar_t* ShellUtil::kBrowserProtocolAssociations[] = {
+ L"http", L"https", L"ipfs", L"ipns", nullptr};
const wchar_t* ShellUtil::kPotentialProtocolAssociations[] = {
L"http", L"https", L"irc", L"mailto", L"mms", L"news", L"nntp",
- L"sms", L"smsto", L"snews", L"tel", L"urn", L"webcal", nullptr};
+ L"sms", L"smsto", L"snews", L"tel", L"urn", L"webcal", L"ipfs",
+ L"ipns", nullptr};
const wchar_t* ShellUtil::kRegUrlProtocol = L"URL Protocol";
const wchar_t* ShellUtil::kRegApplication = L"\\Application";
const wchar_t* ShellUtil::kRegAppUserModelId = L"AppUserModelId";
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
diff --git a/third_party/blink/renderer/platform/weborigin/scheme_registry.cc b/third_party/blink/renderer/platform/weborigin/scheme_registry.cc
index 4eadf46ea0c24..d62fc7fb14e01 100644
index e1bc209c337c5..6fbac29fcddfd 100644
--- a/third_party/blink/renderer/platform/weborigin/scheme_registry.cc
+++ b/third_party/blink/renderer/platform/weborigin/scheme_registry.cc
@@ -67,7 +67,7 @@ class URLSchemesRegistry final {
@@ -68,8 +68,8 @@ class URLSchemesRegistry final {
// is considered secure. Additional checks are performed to ensure that
// other http pages are filtered out.
service_worker_schemes({"http", "https"}),
- fetch_api_schemes({"http", "https"}),
- allowed_in_referrer_schemes({"http", "https"}) {
+ fetch_api_schemes({"http", "https", "ipfs", "ipns"}),
allowed_in_referrer_schemes({"http", "https"}) {
+ allowed_in_referrer_schemes({"http", "https", "ipfs", "ipns"}) {
for (auto& scheme : url::GetCorsEnabledSchemes())
cors_enabled_schemes.insert(scheme.c_str());
for (auto& scheme : url::GetCSPBypassingSchemes()) {
45 changes: 45 additions & 0 deletions chromium_edits/128.0.6613.36/url/url_util.cc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
diff --git a/url/url_util.cc b/url/url_util.cc
index ce5225e121f5d..79e33208f728e 100644
--- a/url/url_util.cc
+++ b/url/url_util.cc
@@ -76,6 +76,8 @@ struct SchemeRegistry {
std::vector<SchemeWithType> referrer_schemes = {
{kHttpsScheme, SCHEME_WITH_HOST_PORT_AND_USER_INFORMATION},
{kHttpScheme, SCHEME_WITH_HOST_PORT_AND_USER_INFORMATION},
+ {"ipfs", SCHEME_WITH_HOST},
+ {"ipns", SCHEME_WITH_HOST},
};

// Schemes that do not trigger mixed content warning.
@@ -84,6 +86,8 @@ struct SchemeRegistry {
kWssScheme,
kDataScheme,
kAboutScheme,
+ {"ipfs", SCHEME_WITH_HOST},
+ {"ipns", SCHEME_WITH_HOST},
};

// Schemes that normal pages cannot link to or access (i.e., with the same
@@ -105,6 +109,8 @@ struct SchemeRegistry {
kHttpsScheme,
kHttpScheme,
kDataScheme,
+ {"ipfs", SCHEME_WITH_HOST},
+ {"ipns", SCHEME_WITH_HOST},
};

// Schemes that can be used by web to store data (local storage, etc).
@@ -308,7 +314,12 @@ bool DoCanonicalize(const CHAR* spec,
success = CanonicalizeFileSystemURL(
spec, ParseFileSystemURL(std::basic_string_view(spec, spec_len)),
charset_converter, output, output_parsed);
-
+ } else if (DoCompareSchemeComponent(spec, scheme, "ipfs")) {
+ auto spec_view = std::basic_string_view(spec, spec_len);
+ // Switch multibase away from case-sensitive ones before continuing canonicalization.
+ auto parsed_input = ParseStandardURL(spec_view);
+ success = CanonicalizeIpfsURL(spec_view, parsed_input, scheme_type,
+ charset_converter, output, output_parsed);
} else if (DoIsStandard(spec, scheme, &scheme_type)) {
// All "normal" URLs.
success = CanonicalizeStandardURL(
18 changes: 0 additions & 18 deletions chromium_edits/128.0.6613.7/url/url_util.cc.patch

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index dfba1dd0fcfa9..220aab649b46a 100644
index fe0452e8bd462..575137d6dbbf9 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -39,6 +39,7 @@ import("//rlz/buildflags/buildflags.gni")
import("//sandbox/features.gni")
@@ -41,6 +41,7 @@ import("//sandbox/features.gni")
import("//services/screen_ai/buildflags/features.gni")
import("//testing/libfuzzer/fuzzer_test.gni")
import("//third_party/blink/public/public_features.gni")
+import("//third_party/ipfs_client/args.gni")
import("//third_party/protobuf/proto_library.gni")
import("//third_party/webrtc/webrtc.gni")
import("//third_party/widevine/cdm/widevine.gni")
@@ -2640,6 +2641,14 @@ static_library("browser") {
@@ -2717,6 +2718,14 @@ static_library("browser") {
]
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index ceae9a5b9433e..5f7dc19a1d06a 100644
index 96370d4ac35a9..82bf3f78caccc 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -214,6 +214,7 @@
@@ -220,6 +220,7 @@
#include "third_party/blink/public/common/features_generated.h"
#include "third_party/blink/public/common/forcedark/forcedark_switches.h"
#include "third_party/blink/public/common/switches.h"
+#include "third_party/ipfs_client/ipfs_buildflags.h"
#include "ui/accessibility/accessibility_features.h"
#include "ui/accessibility/accessibility_switches.h"
#include "ui/base/ozone_buildflags.h"
@@ -308,6 +309,10 @@
@@ -320,6 +321,10 @@
#include "extensions/common/switches.h"
#endif // BUILDFLAG(ENABLE_EXTENSIONS)

Expand All @@ -21,7 +21,7 @@ index ceae9a5b9433e..5f7dc19a1d06a 100644
#if BUILDFLAG(ENABLE_PDF)
#include "pdf/pdf_features.h"
#endif
@@ -9461,6 +9466,14 @@ const FeatureEntry kFeatureEntries[] = {
@@ -10130,6 +10135,14 @@ const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kOmitCorsClientCertDescription, kOsAll,
FEATURE_VALUE_TYPE(network::features::kOmitCorsClientCert)},

Expand Down
Loading
Loading