summaryrefslogtreecommitdiff
path: root/www/chromium-uc/patches/core/ungoogled-chromium/block-trk-and-subdomains.patch
diff options
context:
space:
mode:
Diffstat (limited to 'www/chromium-uc/patches/core/ungoogled-chromium/block-trk-and-subdomains.patch')
-rw-r--r--www/chromium-uc/patches/core/ungoogled-chromium/block-trk-and-subdomains.patch120
1 files changed, 60 insertions, 60 deletions
diff --git a/www/chromium-uc/patches/core/ungoogled-chromium/block-trk-and-subdomains.patch b/www/chromium-uc/patches/core/ungoogled-chromium/block-trk-and-subdomains.patch
index 8b68a77..37961f4 100644
--- a/www/chromium-uc/patches/core/ungoogled-chromium/block-trk-and-subdomains.patch
+++ b/www/chromium-uc/patches/core/ungoogled-chromium/block-trk-and-subdomains.patch
@@ -1,9 +1,9 @@
1# Block all connection requests with 'qjz9zk' in the domain name or with a 'trk:' scheme. 1# Block all connection requests with 'qjz9zk' in the domain name or with a 'trk:' scheme.
2# This patch is based on Iridium's 'net: add "trk:" scheme and help identify URLs being retrieved' 2# This patch is based on Iridium's 'net: add "trk:" scheme and help identify URLs being retrieved'
3 3
4--- chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.orig 4--- a/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc
5+++ chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc 5+++ b/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc
6@@ -56,6 +56,7 @@ ChromeAutocompleteSchemeClassifier::GetI 6@@ -57,6 +57,7 @@ ChromeAutocompleteSchemeClassifier::GetI
7 if (base::IsStringASCII(scheme) && 7 if (base::IsStringASCII(scheme) &&
8 (ProfileIOData::IsHandledProtocol(scheme) || 8 (ProfileIOData::IsHandledProtocol(scheme) ||
9 base::LowerCaseEqualsASCII(scheme, content::kViewSourceScheme) || 9 base::LowerCaseEqualsASCII(scheme, content::kViewSourceScheme) ||
@@ -11,8 +11,8 @@
11 base::LowerCaseEqualsASCII(scheme, url::kJavaScriptScheme) || 11 base::LowerCaseEqualsASCII(scheme, url::kJavaScriptScheme) ||
12 base::LowerCaseEqualsASCII(scheme, url::kDataScheme))) { 12 base::LowerCaseEqualsASCII(scheme, url::kDataScheme))) {
13 return metrics::OmniboxInputType::URL; 13 return metrics::OmniboxInputType::URL;
14--- chrome/browser/history/history_utils.cc.orig 14--- a/chrome/browser/history/history_utils.cc
15+++ chrome/browser/history/history_utils.cc 15+++ b/chrome/browser/history/history_utils.cc
16@@ -21,6 +21,7 @@ bool CanAddURLToHistory(const GURL& url) 16@@ -21,6 +21,7 @@ bool CanAddURLToHistory(const GURL& url)
17 url.SchemeIs(content::kChromeDevToolsScheme) || 17 url.SchemeIs(content::kChromeDevToolsScheme) ||
18 url.SchemeIs(content::kChromeUIScheme) || 18 url.SchemeIs(content::kChromeUIScheme) ||
@@ -21,21 +21,21 @@
21 url.SchemeIs(chrome::kChromeNativeScheme) || 21 url.SchemeIs(chrome::kChromeNativeScheme) ||
22 url.SchemeIs(chrome::kChromeSearchScheme) || 22 url.SchemeIs(chrome::kChromeSearchScheme) ||
23 url.SchemeIs(dom_distiller::kDomDistillerScheme)) 23 url.SchemeIs(dom_distiller::kDomDistillerScheme))
24--- chrome/browser/ui/singleton_tabs.cc.orig 24--- a/chrome/browser/ui/singleton_tabs.cc
25+++ chrome/browser/ui/singleton_tabs.cc 25+++ b/chrome/browser/ui/singleton_tabs.cc
26@@ -99,7 +99,8 @@ int GetIndexOfExistingTab(Browser* brows 26@@ -102,7 +102,8 @@ int GetIndexOfExistingTab(Browser* brows
27 27 // RewriteURLIfNecessary removes the "view-source:" scheme which could lead
28 // Skip view-source tabs. This is needed because RewriteURLIfNecessary 28 // to incorrect matching, so ensure that the target and the candidate are
29 // removes the "view-source:" scheme which leads to incorrect matching. 29 // either both view-source:, or neither is.
30- if (tab_url.SchemeIs(content::kViewSourceScheme)) 30- if (tab_url.SchemeIs(content::kViewSourceScheme) != target_is_view_source) {
31+ if (tab_url.SchemeIs(content::kViewSourceScheme) || 31+ if (tab_url.SchemeIs(content::kViewSourceScheme) != target_is_view_source ||
32+ tab_url.SchemeIs(url::kTraceScheme)) 32+ tab_url.SchemeIs(url::kTraceScheme)) {
33 continue; 33 continue;
34 }
34 35
35 GURL rewritten_tab_url = tab_url; 36--- a/components/omnibox/browser/autocomplete_input.cc
36--- components/omnibox/browser/autocomplete_input.cc.orig 37+++ b/components/omnibox/browser/autocomplete_input.cc
37+++ components/omnibox/browser/autocomplete_input.cc 38@@ -561,7 +561,8 @@ void AutocompleteInput::ParseForEmphasiz
38@@ -533,7 +533,8 @@ void AutocompleteInput::ParseForEmphasiz
39 // For the view-source and blob schemes, we should emphasize the host of the 39 // For the view-source and blob schemes, we should emphasize the host of the
40 // URL qualified by the view-source or blob prefix. 40 // URL qualified by the view-source or blob prefix.
41 if ((base::LowerCaseEqualsASCII(scheme_str, kViewSourceScheme) || 41 if ((base::LowerCaseEqualsASCII(scheme_str, kViewSourceScheme) ||
@@ -45,8 +45,8 @@
45 (static_cast<int>(text.length()) > after_scheme_and_colon)) { 45 (static_cast<int>(text.length()) > after_scheme_and_colon)) {
46 // Obtain the URL prefixed by view-source or blob and parse it. 46 // Obtain the URL prefixed by view-source or blob and parse it.
47 std::u16string real_url(text.substr(after_scheme_and_colon)); 47 std::u16string real_url(text.substr(after_scheme_and_colon));
48--- components/url_formatter/url_fixer.cc.orig 48--- a/components/url_formatter/url_fixer.cc
49+++ components/url_formatter/url_fixer.cc 49+++ b/components/url_formatter/url_fixer.cc
50@@ -562,6 +562,10 @@ GURL FixupURL(const std::string& text, c 50@@ -562,6 +562,10 @@ GURL FixupURL(const std::string& text, c
51 } 51 }
52 } 52 }
@@ -58,19 +58,19 @@
58 // We handle the file scheme separately. 58 // We handle the file scheme separately.
59 if (scheme == url::kFileScheme) 59 if (scheme == url::kFileScheme)
60 return GURL(parts.scheme.is_valid() ? text : FixupPath(text)); 60 return GURL(parts.scheme.is_valid() ? text : FixupPath(text));
61--- content/browser/child_process_security_policy_impl.cc.orig 61--- a/content/browser/child_process_security_policy_impl.cc
62+++ content/browser/child_process_security_policy_impl.cc 62+++ b/content/browser/child_process_security_policy_impl.cc
63@@ -861,6 +861,7 @@ ChildProcessSecurityPolicyImpl::ChildPro 63@@ -732,6 +732,7 @@ ChildProcessSecurityPolicyImpl::ChildPro
64 RegisterWebSafeScheme(url::kWssScheme);
64 #endif // BUILDFLAG(ENABLE_WEBSOCKETS) 65 #endif // BUILDFLAG(ENABLE_WEBSOCKETS)
65 RegisterWebSafeScheme(url::kFtpScheme);
66 RegisterWebSafeScheme(url::kDataScheme); 66 RegisterWebSafeScheme(url::kDataScheme);
67+ RegisterWebSafeScheme(url::kTraceScheme); 67+ RegisterWebSafeScheme(url::kTraceScheme);
68 RegisterWebSafeScheme("feed");
69 68
70 // TODO(nick): https://crbug.com/651534 blob: and filesystem: schemes embed 69 // TODO(nick): https://crbug.com/651534 blob: and filesystem: schemes embed
71--- net/BUILD.gn.orig 70 // other origins, so we should not treat them as web safe. Remove callers of
72+++ net/BUILD.gn 71--- a/net/BUILD.gn
73@@ -1010,6 +1010,8 @@ component("net") { 72+++ b/net/BUILD.gn
73@@ -1019,6 +1019,8 @@ component("net") {
74 "url_request/report_sender.h", 74 "url_request/report_sender.h",
75 "url_request/static_http_user_agent_settings.cc", 75 "url_request/static_http_user_agent_settings.cc",
76 "url_request/static_http_user_agent_settings.h", 76 "url_request/static_http_user_agent_settings.h",
@@ -80,7 +80,7 @@
80 "url_request/url_fetcher.h", 80 "url_request/url_fetcher.h",
81 "url_request/url_fetcher_core.cc", 81 "url_request/url_fetcher_core.cc",
82--- /dev/null 82--- /dev/null
83+++ net/url_request/trk_protocol_handler.cc 83+++ b/net/url_request/trk_protocol_handler.cc
84@@ -0,0 +1,25 @@ 84@@ -0,0 +1,25 @@
85+// Copyright (c) 2018 The ungoogled-chromium Authors. All rights reserved. 85+// Copyright (c) 2018 The ungoogled-chromium Authors. All rights reserved.
86+// Use of this source code is governed by a BSD-style license that can be 86+// Use of this source code is governed by a BSD-style license that can be
@@ -108,8 +108,8 @@
108+ 108+
109+} // namespace net 109+} // namespace net
110--- /dev/null 110--- /dev/null
111+++ net/url_request/trk_protocol_handler.h 111+++ b/net/url_request/trk_protocol_handler.h
112@@ -0,0 +1,32 @@ 112@@ -0,0 +1,30 @@
113+// Copyright (c) 2018 The ungoogled-chromium Authors. All rights reserved. 113+// Copyright (c) 2018 The ungoogled-chromium Authors. All rights reserved.
114+// Use of this source code is governed by a BSD-style license that can be 114+// Use of this source code is governed by a BSD-style license that can be
115+// found in the LICENSE file. 115+// found in the LICENSE file.
@@ -118,7 +118,6 @@
118+#define NET_URL_REQUEST_TRK_PROTOCOL_HANDLER_H_ 118+#define NET_URL_REQUEST_TRK_PROTOCOL_HANDLER_H_
119+ 119+
120+#include "base/compiler_specific.h" 120+#include "base/compiler_specific.h"
121+#include "base/macros.h"
122+#include "net/base/net_export.h" 121+#include "net/base/net_export.h"
123+#include "net/url_request/url_request_job_factory.h" 122+#include "net/url_request/url_request_job_factory.h"
124+ 123+
@@ -131,19 +130,18 @@
131+ : public URLRequestJobFactory::ProtocolHandler { 130+ : public URLRequestJobFactory::ProtocolHandler {
132+ public: 131+ public:
133+ TrkProtocolHandler(); 132+ TrkProtocolHandler();
133+ TrkProtocolHandler(const TrkProtocolHandler&) = delete;
134+ TrkProtocolHandler& operator=(const TrkProtocolHandler&) = delete;
134+ std::unique_ptr<URLRequestJob> CreateJob( 135+ std::unique_ptr<URLRequestJob> CreateJob(
135+ URLRequest* request) const override; 136+ URLRequest* request) const override;
136+ bool IsSafeRedirectTarget(const GURL& location) const override; 137+ bool IsSafeRedirectTarget(const GURL& location) const override;
137+
138+ private:
139+ DISALLOW_COPY_AND_ASSIGN(TrkProtocolHandler);
140+}; 138+};
141+ 139+
142+} // namespace net 140+} // namespace net
143+ 141+
144+#endif // NET_URL_REQUEST_TRK_PROTOCOL_HANDLER_H_ 142+#endif // NET_URL_REQUEST_TRK_PROTOCOL_HANDLER_H_
145--- net/url_request/url_request.cc.orig 143--- a/net/url_request/url_request.cc
146+++ net/url_request/url_request.cc 144+++ b/net/url_request/url_request.cc
147@@ -12,6 +12,7 @@ 145@@ -12,6 +12,7 @@
148 #include "base/compiler_specific.h" 146 #include "base/compiler_specific.h"
149 #include "base/metrics/histogram_macros.h" 147 #include "base/metrics/histogram_macros.h"
@@ -152,7 +150,7 @@
152 #include "base/strings/utf_string_conversions.h" 150 #include "base/strings/utf_string_conversions.h"
153 #include "base/synchronization/lock.h" 151 #include "base/synchronization/lock.h"
154 #include "base/threading/thread_task_runner_handle.h" 152 #include "base/threading/thread_task_runner_handle.h"
155@@ -46,6 +47,7 @@ 153@@ -45,6 +46,7 @@
156 #include "net/url_request/url_request_redirect_job.h" 154 #include "net/url_request/url_request_redirect_job.h"
157 #include "url/gurl.h" 155 #include "url/gurl.h"
158 #include "url/origin.h" 156 #include "url/origin.h"
@@ -160,7 +158,7 @@
160 158
161 using base::Time; 159 using base::Time;
162 using std::string; 160 using std::string;
163@@ -595,6 +597,12 @@ URLRequest::URLRequest(const GURL& url, 161@@ -609,6 +611,12 @@ URLRequest::URLRequest(const GURL& url,
164 // Sanity check out environment. 162 // Sanity check out environment.
165 DCHECK(base::ThreadTaskRunnerHandle::IsSet()); 163 DCHECK(base::ThreadTaskRunnerHandle::IsSet());
166 164
@@ -173,17 +171,17 @@
173 context->url_requests()->insert(this); 171 context->url_requests()->insert(this);
174 net_log_.BeginEvent(NetLogEventType::REQUEST_ALIVE, [&] { 172 net_log_.BeginEvent(NetLogEventType::REQUEST_ALIVE, [&] {
175 return NetLogURLRequestConstructorParams(url, priority_, 173 return NetLogURLRequestConstructorParams(url, priority_,
176--- net/url_request/url_request_context_builder.cc.orig 174--- a/net/url_request/url_request_context_builder.cc
177+++ net/url_request/url_request_context_builder.cc 175+++ b/net/url_request/url_request_context_builder.cc
178@@ -46,6 +46,7 @@ 176@@ -48,6 +48,7 @@
179 #include "net/quic/quic_stream_factory.h" 177 #include "net/socket/network_binding_client_socket_factory.h"
180 #include "net/ssl/ssl_config_service_defaults.h" 178 #include "net/ssl/ssl_config_service_defaults.h"
181 #include "net/url_request/static_http_user_agent_settings.h" 179 #include "net/url_request/static_http_user_agent_settings.h"
182+#include "net/url_request/trk_protocol_handler.h" 180+#include "net/url_request/trk_protocol_handler.h"
183 #include "net/url_request/url_request_context.h" 181 #include "net/url_request/url_request_context.h"
184 #include "net/url_request/url_request_context_storage.h" 182 #include "net/url_request/url_request_context_storage.h"
185 #include "net/url_request/url_request_job_factory.h" 183 #include "net/url_request/url_request_job_factory.h"
186@@ -546,6 +547,9 @@ std::unique_ptr<URLRequestContext> URLRe 184@@ -618,6 +619,9 @@ std::unique_ptr<URLRequestContext> URLRe
187 } 185 }
188 protocol_handlers_.clear(); 186 protocol_handlers_.clear();
189 187
@@ -193,28 +191,30 @@
193 storage->set_job_factory(std::move(job_factory)); 191 storage->set_job_factory(std::move(job_factory));
194 192
195 return std::move(context); 193 return std::move(context);
196--- url/url_constants.cc.orig 194--- a/url/url_constants.cc
197+++ url/url_constants.cc 195+++ b/url/url_constants.cc
198@@ -28,6 +28,7 @@ const char kMailToScheme[] = "mailto"; 196@@ -46,6 +46,8 @@ const char kQuicTransportScheme[] = "qui
199 // See also: https://www.iana.org/assignments/uri-schemes/prov/quic-transport 197 const char16_t kQuicTransportScheme16[] = u"quic-transport";
200 const char kQuicTransportScheme[] = "quic-transport";
201 const char kTelScheme[] = "tel"; 198 const char kTelScheme[] = "tel";
199 const char16_t kTelScheme16[] = u"tel";
202+const char kTraceScheme[] = "trk"; 200+const char kTraceScheme[] = "trk";
201+const char16_t kTraceScheme16[] = u"trk";
203 const char kUrnScheme[] = "urn"; 202 const char kUrnScheme[] = "urn";
204 const char kWsScheme[] = "ws"; 203 const char16_t kUrnScheme16[] = u"urn";
205 const char kWssScheme[] = "wss"; 204 const char kUuidInPackageScheme[] = "uuid-in-package";
206--- url/url_constants.h.orig 205--- a/url/url_constants.h
207+++ url/url_constants.h 206+++ b/url/url_constants.h
208@@ -32,6 +32,7 @@ COMPONENT_EXPORT(URL) extern const char 207@@ -50,6 +50,8 @@ COMPONENT_EXPORT(URL) extern const char
209 COMPONENT_EXPORT(URL) extern const char kMailToScheme[]; 208 COMPONENT_EXPORT(URL) extern const char16_t kQuicTransportScheme16[];
210 COMPONENT_EXPORT(URL) extern const char kQuicTransportScheme[];
211 COMPONENT_EXPORT(URL) extern const char kTelScheme[]; 209 COMPONENT_EXPORT(URL) extern const char kTelScheme[];
210 COMPONENT_EXPORT(URL) extern const char16_t kTelScheme16[];
212+COMPONENT_EXPORT(URL) extern const char kTraceScheme[]; 211+COMPONENT_EXPORT(URL) extern const char kTraceScheme[];
212+COMPONENT_EXPORT(URL) extern const char16_t kTraceScheme16[];
213 COMPONENT_EXPORT(URL) extern const char kUrnScheme[]; 213 COMPONENT_EXPORT(URL) extern const char kUrnScheme[];
214 COMPONENT_EXPORT(URL) extern const char kWsScheme[]; 214 COMPONENT_EXPORT(URL) extern const char16_t kUrnScheme16[];
215 COMPONENT_EXPORT(URL) extern const char kWssScheme[]; 215 COMPONENT_EXPORT(URL) extern const char kUuidInPackageScheme[];
216--- url/url_util.cc.orig 216--- a/url/url_util.cc
217+++ url/url_util.cc 217+++ b/url/url_util.cc
218@@ -63,7 +63,7 @@ struct SchemeRegistry { 218@@ -63,7 +63,7 @@ struct SchemeRegistry {
219 219
220 // Schemes that do not trigger mixed content warning. 220 // Schemes that do not trigger mixed content warning.