Compare commits

...
Author SHA1 Message Date
csagan5 39f5761729 Added explanation for Google Sync
Removed no-more-working (and dubious) patch
2017-11-14 08:56:41 +01:00
CarlandGitHub 10cc8c8310 Fixed formatting, added 63.0.3239.38 2017-11-07 23:22:59 +01:00
csagan5 4c844ba92d Added new release to changelog 2017-11-02 20:49:34 +01:00
csagan5 d855bc2f8f Add correct URL 2017-10-31 10:27:11 +01:00
csagan5 bffc981dca Add license shield 2017-10-31 10:25:04 +01:00
csagan5 fc970af553 Add title to logo 2017-10-31 10:21:27 +01:00
csagan5 fb79f25139 Add shield URLs 2017-10-31 10:19:19 +01:00
csagan5 3f68ef470d Add version badge 2017-10-31 10:17:14 +01:00
csagan5 ce004bc49a Mention removal of AMP from search results 2017-10-30 17:53:16 +01:00
csagan5 a99533f633 Latest version of the patch with AMP removal 2017-10-30 17:49:04 +01:00
csagan5 a300522aed Re-instated patch that works 2017-10-29 07:04:12 +01:00
6 changed files with 133 additions and 152 deletions
+24 -13
View File
@@ -1,8 +1,19 @@
# 63.0.3239.46
* removed search engine geolocation default patch
# 63.0.3239.38
# 63.0.3239.27
# 63.0.3239.24
* convert AMP search results to regular search results
# 63.0.3239.15
* remove URL tracking from Google search results
* disable webRTC by default (https://github.com/bromite/bromite/issues/9, still not working proper)
* do not enable search engine geolocation by default
* use own package name (closes https://github.com/bromite/bromite/issues/1)
* use 64bit WebView process
# 63.0.3239.10
* attempt enabling API keys (didn't work)
@@ -17,16 +28,16 @@
* first release with NoChromo adblocking patch
* Bromite patch: disable NTP remote suggestions
* added some Inox/Iridium/Ungoogled-Chromium patches, namely:
** DuckDuckGo search engine
** disable battery status service
** disable formatting in OmniBox
** disable GCM status checks
** use local fonts instead of fonts from Google servers
** disable updater pings
** do not enable Google integrations by default (translation, lookup, etc)
** disable the ad promo system
** do not store passwords by default
** do not fetch Google promotions
** restore classic NTP
** only keep cookies until exit
** block third-party cookies
* DuckDuckGo search engine
* disable battery status service
* disable formatting in OmniBox
* disable GCM status checks
* use local fonts instead of fonts from Google servers
* disable updater pings
* do not enable Google integrations by default (translation, lookup, etc)
* disable the ad promo system
* do not store passwords by default
* do not fetch Google promotions
* restore classic NTP
* only keep cookies until exit
* block third-party cookies
+15 -2
View File
@@ -1,6 +1,8 @@
# Bromite - Take back your browser
<img src="https://www.bromite.org/android-icon-192x192.png" width="96" alt="Bromite" />
[![GitHub release][version-image]][version-url] [![license][license-image]][license-url]
<img title="Bromite - take back your browser!" src="https://www.bromite.org/android-icon-192x192.png" width="96" alt="Bromite" />
Bromite is [Chromium](https://www.chromium.org/Home) plus some patches for ad blocking and enhanced privacy.
@@ -23,13 +25,19 @@ ETH donations address: `0xf47ff39223d828f99fec5ab53bd068c5c0522042`
# Features
* adblocking (currently baked-in, no configuration options available)
* remove click-tracking from Google search results
* remove click-tracking and AMP from Google search results
* [StartPage](https://startpage.com/) search engine (select it from search engines under settings)
* [DuckDuckGo](https://duckduckgo.com/) search engine (select it from search engines under settings)
* privacy enhancement patches from Inox patchset, ungoogled-chromium and Iridium projects
* all codecs included (proprietary, open H.264 etc.)
* built with official Chrome optimizations
# F.A.Q.
## Does Google Sync work?
No. You would have to use your own API keys, which I do not know how you could pass via environment variables on Android.
This is not a limitation of Bromite but of all Chromium-based projects in general, as general public is not allowed to use Google's APIs for free unless when using Chrome.
# Releases
A build server goes through the very lengthy build operation and then new versions are available in this project as [releases](https://github.com/bromite/bromite/releases).
@@ -54,3 +62,8 @@ Please refer to [official Chromium build documentation](https://www.chromium.org
# License
The patches published as part of the Bromite project are released under [GNU GPL v3](./LICENSE).
[version-image]: https://img.shields.io/github/release/bromite/bromite.svg?style=flat-square
[version-url]: https://github.com/bromite/bromite/releases/latest
[license-image]: https://img.shields.io/github/license/bromite/bromite.svg
[license-url]: https://github.com/bromite/bromite/blob/master/LICENSE
@@ -0,0 +1,26 @@
From ee80624a6cad6e19a281a59cfea32f406e7ee03d Mon Sep 17 00:00:00 2001
From: Daniel Micay <danielmicay@gmail.com>
Date: Thu, 26 Jan 2017 01:30:12 -0500
Subject: [PATCH 12/21] use 64-bit WebView processes
---
android_webview/apk/java/AndroidManifest.xml | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/android_webview/apk/java/AndroidManifest.xml b/android_webview/apk/java/AndroidManifest.xml
index 23b55ecb437a..3f7212fe2807 100644
--- a/android_webview/apk/java/AndroidManifest.xml
+++ b/android_webview/apk/java/AndroidManifest.xml
@@ -20,8 +20,7 @@
<application android:label="Android System WebView"
android:icon="@drawable/icon_webview"
- android:multiArch="true"
- android:use32bitAbi="true">
+ android:multiArch="true">
{# This part is shared between stand-alone WebView and Monochrome #}
{% macro common(manifest_package, webview_lib) %}
<meta-data android:name="com.android.webview.WebViewLibrary"
--
2.14.2
@@ -1,69 +0,0 @@
From bc266421a13f4967a3d5b49830c338f59e4f2dd5 Mon Sep 17 00:00:00 2001
From: Daniel Micay <danielmicay@gmail.com>
Date: Tue, 1 Aug 2017 20:29:56 -0400
Subject: [PATCH 19/21] stop enabling search engine geolocation by default
---
.../search_geolocation_service.cc | 25 ++++++++++------------
1 file changed, 11 insertions(+), 14 deletions(-)
diff --git a/chrome/browser/android/search_geolocation/search_geolocation_service.cc b/chrome/browser/android/search_geolocation/search_geolocation_service.cc
index 0ed5540c3262..e5721d53c344 100644
--- a/chrome/browser/android/search_geolocation/search_geolocation_service.cc
+++ b/chrome/browser/android/search_geolocation/search_geolocation_service.cc
@@ -208,7 +208,14 @@ void SearchGeolocationService::SetDSEGeolocationSetting(bool setting) {
pref.setting = setting;
SetDSEGeolocationPref(pref);
- ResetContentSetting();
+ url::Origin origin = delegate_->GetDSEOrigin();
+ if (setting) {
+ host_content_settings_map_->SetContentSettingDefaultScope(
+ origin.GetURL(), origin.GetURL(), CONTENT_SETTINGS_TYPE_GEOLOCATION,
+ std::string(), CONTENT_SETTING_ALLOW);
+ } else {
+ ResetContentSetting();
+ }
}
url::Origin SearchGeolocationService::GetDSEOriginIfEnabled() {
@@ -232,11 +239,7 @@ void SearchGeolocationService::OnDSEChanged() {
// Remove any geolocation embargo on the URL.
PermissionDecisionAutoBlocker::GetForProfile(profile_)->RemoveEmbargoByUrl(
delegate_->GetDSEOrigin().GetURL(), CONTENT_SETTINGS_TYPE_GEOLOCATION);
- if (content_setting == CONTENT_SETTING_BLOCK && pref.setting) {
- pref.setting = false;
- } else if (content_setting == CONTENT_SETTING_ALLOW && !pref.setting) {
- ResetContentSetting();
- }
+ pref.setting = content_setting == CONTENT_SETTING_ALLOW;
if (new_dse_name != pref.dse_name && pref.setting)
SearchGeolocationDisclosureTabHelper::ResetDisclosure(profile_);
@@ -279,7 +282,7 @@ void SearchGeolocationService::InitializeDSEGeolocationSettingIfNeeded() {
PrefValue pref;
pref.dse_name = delegate_->GetDSEName();
- pref.setting = content_setting != CONTENT_SETTING_BLOCK;
+ pref.setting = content_setting == CONTENT_SETTING_ALLOW;
SetDSEGeolocationPref(pref);
SearchGeolocationDisclosureTabHelper::ResetDisclosure(profile_);
@@ -289,13 +292,7 @@ void SearchGeolocationService::InitializeDSEGeolocationSettingIfNeeded() {
void SearchGeolocationService::EnsureDSEGeolocationSettingIsValid() {
PrefValue pref = GetDSEGeolocationPref();
ContentSetting content_setting = GetCurrentContentSetting();
- bool new_setting = pref.setting;
-
- if (pref.setting && content_setting == CONTENT_SETTING_BLOCK) {
- new_setting = false;
- } else if (!pref.setting && content_setting == CONTENT_SETTING_ALLOW) {
- new_setting = true;
- }
+ bool new_setting = content_setting == CONTENT_SETTING_ALLOW;
if (pref.setting != new_setting) {
pref.setting = new_setting;
--
2.14.2
@@ -0,0 +1,68 @@
commit 39ee52cbd24fe20205f146873dddb4063b80f546
Author: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sat Oct 28 10:09:41 2017 +0200
Do not track google search results clicks, remove AMP
diff --git a/third_party/WebKit/Source/core/dom/BUILD.gn b/third_party/WebKit/Source/core/dom/BUILD.gn
index b636bb4..d2e30a1 100644
--- a/third_party/WebKit/Source/core/dom/BUILD.gn
+++ b/third_party/WebKit/Source/core/dom/BUILD.gn
@@ -344,6 +344,7 @@ blink_core_sources("dom") {
"events/TreeScopeEventContext.h",
"events/WindowEventContext.cpp",
"events/WindowEventContext.h",
+ "extensions/dont-track-me.h",
"ng/flat_tree_traversal_ng.cc",
"ng/flat_tree_traversal_ng.h",
"trustedtypes/TrustedHTML.cpp",
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index b53451c..ecfa473 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -218,6 +218,7 @@
#include "core/xml/parser/XMLDocumentParser.h"
#include "core/xml_names.h"
#include "core/xmlns_names.h"
+#include "extensions/dont-track-me.h"
#include "platform/CrossThreadFunctional.h"
#include "platform/DateComponents.h"
#include "platform/EventDispatchForbiddenScope.h"
@@ -5826,8 +5827,24 @@ void Document::FinishedParsing() {
fetcher_->ClearResourcesFromPreviousFetcher();
}
- if (IsPrefetchOnly())
+ if (IsPrefetchOnly()) {
WebPrerenderingSupport::Current()->PrefetchFinished();
+ return;
+ }
+
+ // determine whether this is a Google search results page
+ SecurityOrigin *origin = GetSecurityOrigin();
+ if (origin) {
+ WTF::String domain = origin->Domain();
+ size_t pos = domain.Find(".google.");
+ auto* bodyElement = body();
+ if (bodyElement && (pos != WTF::kNotFound) && (domain.length() - pos - 8 < 4)) {
+ LOG(INFO) << "BRM: injecting dont-track-me Javascript payload";
+ HTMLScriptElement* e = HTMLScriptElement::Create(*this, false);
+ e->setText(DONT_TRACK_ME_JS);
+ bodyElement->AppendChild(e);
+ }
+ }
}
void Document::ElementDataCacheClearTimerFired(TimerBase*) {
diff --git a/third_party/WebKit/Source/core/dom/extensions/dont-track-me.h b/third_party/WebKit/Source/core/dom/extensions/dont-track-me.h
new file mode 100644
index 0000000..d6be4c1
--- /dev/null
+++ b/third_party/WebKit/Source/core/dom/extensions/dont-track-me.h
@@ -0,0 +1,6 @@
+#ifndef dont_track_me_h
+#define dont_track_me_h
+
+#define DONT_TRACK_ME_JS "// Bromite click-tracking and AMP removal\nfunction recreateHyperlink(a) {\n // create new A element - old one has event listeners attached\n var newA = document.createElement('a');\n newA.referrerPolicy = 'origin';\n\n // remove AMP class, get actual page URL\n var ampCur = a.getAttribute('data-amp-cur');\n if (ampCur) {\n newA.href = ampCur;\n a.classList.remove('amp_r');\n } else {\n var realLink = getRealLinkFromGoogleUrl(a);\n if (realLink) {\n newA.href = realLink;\n } else {\n // might not be an actual hyperlink, ignore it\n if (!a.href) {\n return;\n }\n newA.href = a.href;\n }\n }\n // copy CSS classes\n newA.className = a.className;\n\n // copy nodes inside the hyperlink\n while (a.firstChild) {\n newA.appendChild(a.lastChild);\n }\n // replace hyperlink\n a.parentNode.replaceChild(newA, a);\n}\n\n/**\n * @returns {String} the real URL if the given link is a Google redirect URL.\n */\nfunction getRealLinkFromGoogleUrl(a) {\n if ((a.hostname === location.hostname || a.hostname === 'www.google.com') &&\n /^\\/(local_)?url$/.test(a.pathname)) {\n // Google Maps / Dito (/local_url?q=<url>)\n // Mobile (/url?q=<url>)\n var url = /[?&](?:q|url)=((?:https?|ftp)[%:][^&]+)/.exec(a.search);\n if (url) {\n return decodeURIComponent(url[1]);\n }\n // Help pages, e.g. safe browsing (/url?...&q=%2Fsupport%2Fanswer...)\n url = /[?&](?:q|url)=((?:%2[Ff]|\\/)[^&]+)/.exec(a.search);\n if (url) {\n return a.origin + decodeURIComponent(url[1]);\n }\n }\n}\n\nfunction sanitizeAllHyperlinks() {\n // scan all hyperlinks\n var hyperlinks = document.getElementsByTagName('a');\n for (var i = 0; i < hyperlinks.length; i++) {\n recreateHyperlink(hyperlinks[i]);\n }\n}\n\nsanitizeAllHyperlinks();\n"
+
+#endif // dont_track_me_h
@@ -1,68 +0,0 @@
commit 9032b89c5a4c28d43c5a13f8bc151c71acad874b
Author: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sat Oct 28 10:09:41 2017 +0200
Do not track google search results clicks
diff --git a/third_party/WebKit/Source/core/dom/BUILD.gn b/third_party/WebKit/Source/core/dom/BUILD.gn
index 93f080f..2df8d30 100644
--- a/third_party/WebKit/Source/core/dom/BUILD.gn
+++ b/third_party/WebKit/Source/core/dom/BUILD.gn
@@ -344,6 +344,7 @@ blink_core_sources("dom") {
"events/TreeScopeEventContext.h",
"events/WindowEventContext.cpp",
"events/WindowEventContext.h",
+ "extensions/dont-track-me.h",
"trustedtypes/TrustedHTML.cpp",
"trustedtypes/TrustedHTML.h",
"trustedtypes/TrustedScriptURL.cpp",
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index b7c5748..4978c84 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -218,6 +218,7 @@
#include "core/xml/parser/XMLDocumentParser.h"
#include "core/xml_names.h"
#include "core/xmlns_names.h"
+#include "extensions/dont-track-me.h"
#include "platform/CrossThreadFunctional.h"
#include "platform/DateComponents.h"
#include "platform/EventDispatchForbiddenScope.h"
@@ -5825,8 +5826,24 @@ void Document::FinishedParsing() {
fetcher_->ClearResourcesFromPreviousFetcher();
}
- if (IsPrefetchOnly())
+ if (IsPrefetchOnly()) {
WebPrerenderingSupport::Current()->PrefetchFinished();
+ return;
+ }
+
+ // determine whether this is a Google search results page
+ SecurityOrigin *origin = GetSecurityOrigin();
+ if (origin) {
+ WTF::String domain = origin->Domain();
+ size_t pos = domain.Find(".google.");
+ auto* bodyElement = body();
+ if (bodyElement && (pos != WTF::kNotFound) && (domain.length() - pos - 8 < 4)) {
+ LOG(INFO) << "BRM: injecting dont-track-me Javascript payload";
+ HTMLScriptElement* e = HTMLScriptElement::Create(*this, false);
+ e->setText(DONT_TRACK_ME_JS);
+ bodyElement->AppendChild(e);
+ }
+ }
}
void Document::ElementDataCacheClearTimerFired(TimerBase*) {
diff --git a/third_party/WebKit/Source/core/dom/extensions/dont-track-me.h b/third_party/WebKit/Source/core/dom/extensions/dont-track-me.h
new file mode 100644
index 0000000..57a7670
--- /dev/null
+++ b/third_party/WebKit/Source/core/dom/extensions/dont-track-me.h
@@ -0,0 +1,6 @@
+#ifndef dont_track_me_h
+#define dont_track_me_h
+
+#define DONT_TRACK_ME_JS "/* click-tracking removal - from https://github.com/Rob--W/dont-track-me-google */\n\nfunction sanitizeHyperlink(a) {\n var inlineMousedown = a.getAttribute('onmousedown');\n // return rwt(....); // E.g Google search results.\n // return google.rwt(...); // E.g. sponsored search results\n // return google.arwt(this); // E.g. sponsored search results (dec 2016).\n if (inlineMousedown && /\\ba?rwt\\(/.test(inlineMousedown)) {\n a.removeAttribute('onmousedown');\n }\n var realLink = getRealLinkFromGoogleUrl(a);\n if (realLink) {\n a.href = realLink;\n }\n a.referrerPolicy = 'origin';\n\n var ping = a.getAttribute('ping');\n if (ping && /\\/url\\?/.test(ping)) {\n a.removeAttribute('oncontextmenu');\n a.removeAttribute('ping');\n }\n}\n\n/**\n * @returns {String} the real URL if the given link is a Google redirect URL.\n */\nfunction getRealLinkFromGoogleUrl(a) {\n if ((a.hostname === location.hostname || a.hostname === 'www.google.com') &&\n /^\\/(local_)?url$/.test(a.pathname)) {\n // Google Maps / Dito (/local_url?q=<url>)\n // Mobile (/url?q=<url>)\n var url = /[?&](?:q|url)=((?:https?|ftp)[%:][^&]+)/.exec(a.search);\n if (url) {\n return decodeURIComponent(url[1]);\n }\n // Help pages, e.g. safe browsing (/url?...&q=%2Fsupport%2Fanswer...)\n url = /[?&](?:q|url)=((?:%2[Ff]|\\/)[^&]+)/.exec(a.search);\n if (url) {\n return a.origin + decodeURIComponent(url[1]);\n }\n }\n}\n\nfunction sanitizeAllHyperlinks() {\n\t// scan all hyperlinks\n\tvar hyperlinks = document.getElementsByTagName('a');\n\tfor(var i = 0; i < hyperlinks.length; i++) {\n\t\tvar a = hyperlinks[i];\n\t\tif (a.href)\n\t\t\tsanitizeHyperlink(a);\n\t}\n}\n\nsanitizeAllHyperlinks();\n"
+
+#endif // dont_track_me_h