Compare commits

...
Author SHA1 Message Date
csagan5 dbc43b5c36 Split non-privacy related features 2018-08-01 13:14:57 +02:00
csagan5 92aba62fdf License svg sometimes fails, use a static one 2018-08-01 13:12:38 +02:00
csagan5 d8db805929 Release 68.0.3440.81 2018-07-29 14:10:58 +02:00
csagan5 9ea0219fce Mention F-Droid repository 2018-07-25 16:49:41 +02:00
6 changed files with 956 additions and 660 deletions
+4
View File
@@ -1,3 +1,7 @@
# 68.0.3440.81
* fix issue with filters with an excluded domain option
* updated AdBlock filters
# 68.0.3440.72
* fix crash during some canvas rendering (fixes https://github.com/bromite/bromite/issues/95)
* new approach to adblock filtering (fixes https://github.com/bromite/bromite/issues/90)
+7 -3
View File
@@ -1,6 +1,6 @@
# Bromite - Take back your browser
<img src="https://www.bromite.org/release.svg" alt="current Bromite release" title="current Bromite release" /> [![license][license-image]][license-url]
<img src="https://www.bromite.org/release.svg" alt="current Bromite release" title="current Bromite release" /> <img src="https://www.bromite.org/license.svg" alt="GNU GPL v3" title="GNU VPL v3" />
<img title="Bromite - take back your browser!" src="https://www.bromite.org/android-icon-192x192.png" width="96" alt="Bromite" />
@@ -57,7 +57,9 @@ We cannot add add-ons to Bromite (merely some features) and anyway HTTPS everywh
No, and this is unlikely to change. The Play Store would not allow total freedom on the adblocking choice, amongst other limitations.
## Is Bromite on F-Droid?
No and there are no plans to support it; but feel free to submit it yourself.
It is not on the official F-Droid repository and there are no (more) plans to submit it.
You can use F-Droid client to install and receive updates via [the official Bromite F-Droid repository](https://www.bromite.org/fdroid).
## Does Bromite support WebRTC?
No, it is not built-in.
@@ -67,10 +69,12 @@ No, it is not built-in.
* baked-in adblock engine with filters from EasyList, EasyPrivacy and others
* remove click-tracking and AMP from search results
* DNS-over-HTTPS support via Google/CloudFlare servers
* allow playing videos in background
* [StartPage](https://startpage.com/), [DuckDuckGo](https://duckduckgo.com/) and [Qwant](https://www.qwant.com/) search engines
* privacy enhancement patches from [Iridium](https://iridiumbrowser.de/), [Inox patchset](https://github.com/gcarq/inox-patchset), [Brave](https://brave.com/) and [ungoogled-chromium](https://github.com/Eloston/ungoogled-chromium) projects
* webRTC, canvas, audio and other anti-fingerprinting mitigations
## Features not related to privacy
* allow playing videos in background
* all codecs included (proprietary, open H.264 etc.)
* built with official speed optimizations
+887 -603
View File
File diff suppressed because one or more lines are too long
@@ -152,7 +152,7 @@ diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml
--- a/tools/metrics/histograms/histograms.xml
+++ b/tools/metrics/histograms/histograms.xml
@@ -111319,6 +111319,7 @@ uploading your change for review.
@@ -111339,6 +111339,7 @@ uploading your change for review.
<suffix name="Overestimate"
label="Tracks when the compositor's estimates were too high and by how
much."/>
+49 -46
View File
@@ -22,12 +22,12 @@ Perform adblock interception in StartJob to address lagging issues
.../java/strings/android_chrome_strings.grd | 11 +
.../subresource_filter_content_settings_manager.cc | 3 +
net/BUILD.gn | 9 +-
net/url_request/adblock_intercept.cc | 326 +++++++++++++++++++++
net/url_request/adblock_intercept.cc | 329 +++++++++++++++++++++
net/url_request/adblock_intercept.h | 18 ++
net/url_request/nochromo_intercept.cc | 116 --------
net/url_request/nochromo_intercept.h | 13 -
net/url_request/url_request.cc | 36 ++-
14 files changed, 477 insertions(+), 134 deletions(-)
14 files changed, 480 insertions(+), 134 deletions(-)
create mode 100644 net/url_request/adblock_intercept.cc
create mode 100644 net/url_request/adblock_intercept.h
delete mode 100644 net/url_request/nochromo_intercept.cc
@@ -251,7 +251,7 @@ diff --git a/net/url_request/adblock_intercept.cc b/net/url_request/adblock_inte
new file mode 100644
--- /dev/null
+++ b/net/url_request/adblock_intercept.cc
@@ -0,0 +1,326 @@
@@ -0,0 +1,329 @@
+#include "url/gurl.h"
+
+#ifdef ADB_TESTER
@@ -431,69 +431,69 @@ new file mode 100644
+ return match;
+}
+
+bool url_match_domain(adblock_entry *entry, const std::string &origin_host) {
+ bool match_domain = true;
+ // check for a negative domain match
+ if (entry->domains_neg) {
+ if (origin_host.empty()) {
+ // skip this rule, cannot match on domain
+ return false;
+ }
+ for (int d = 0; const char *domain = entry->domains_neg[d]; d++) {
+static int url_match_domain(adblock_entry *entry, const std::string &origin_host) {
+ if (entry->domains_skip && !origin_host.empty()) {
+ // filter will not be activated on these domains
+ for (int d = 0; const char *domain = entry->domains_skip[d]; d++) {
+ if (domain == origin_host) {
+ match_domain = false;
+ break;
+ // this domain is whitelisted, do not further process this rule in any way
+ return 0;
+ }
+ }
+ }
+ // fallthrough is desired
+
+ if (!entry->domains || origin_host.empty()) {
+ // undetermined
+ return 3;
+ }
+
+ // filter will be active only if a domain matches
+ // if none matches, the filter is to be skipped
+ for (int d = 0; const char *domain = entry->domains[d]; d++) {
+ if (domain == origin_host) {
+ // this domain is one of those that activate the rule
+ return 1;
+ }
+ }
+
+ // check for a required positive domain match
+ if (entry->domains) {
+ if (origin_host.empty()) {
+ // skip this rule, cannot match on domain
+ return false;
+ }
+ for (int d = 0; const char *domain = entry->domains[d]; d++) {
+ if (domain != origin_host) {
+ match_domain = false;
+ break;
+ }
+ }
+ }
+ return match_domain;
+ // at least one domain should have been found, but none was
+ // thus the filter must be skipped
+ return 0;
+}
+
+static bool url_match_party(adblock_entry *entry, const GURL &url,
+ const std::string &origin_host, bool &checked_fp,
+ bool &fp) {
+ bool wanted_fp;
+static int url_match_party(adblock_entry *entry, const GURL &url,
+ const std::string &origin_host, int &fp) {
+ int desired_fp;
+ if ((entry->flags & ADBLOCK_FLAG_THIRD_PARTY) != 0) {
+ wanted_fp = false;
+ desired_fp = 0;
+ } else if ((entry->flags & ADBLOCK_FLAG_FIRST_PARTY) != 0) {
+ wanted_fp = true;
+ desired_fp = 1;
+ } else {
+ // no-op
+ return true;
+ // undetermined, it does not test for first/third party
+ return 3;
+ }
+
+ if (origin_host.empty()) {
+ // cannot match this rule, no origin host to determine first/third party
+ return false;
+ return 0;
+ }
+
+#ifdef ADB_TESTER
+//__android_log_print(ANDROID_LOG_INFO, LOG_TAG, "matchFirst=%d matchThird=%d",
+// matchFirstParty, matchThirdParty);
+#endif
+ if (!checked_fp) {
+ if (fp == 3) {
+ // lower-case version
+ char *l_host = strtolower(origin_host.c_str()),
+ *l_url_host = strtolower(url.host().c_str());
+
+ // is the URL a first-party to the current page's host?
+ fp = is_first_party(l_host, l_url_host);
+ if (is_first_party(l_host, l_url_host))
+ fp = 1;
+ else
+ fp = 0;
+
+ checked_fp = true;
+#ifdef ADB_TESTER
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG,
+ "is_first_party(\"%s\", \"%s\") = %s", l_host,
@@ -503,7 +503,7 @@ new file mode 100644
+ free(l_url_host);
+ }
+
+ return fp == wanted_fp;
+ return fp == desired_fp ? 1 : 0;
+}
+
+int adblock_intercept(const GURL &url, const std::string &origin_host) {
@@ -522,7 +522,7 @@ new file mode 100644
+ c_url, url.host().c_str(), origin_host.c_str());
+#endif
+
+ bool checked_fp = false, fp = false;
+ int fp = 3;
+
+ bool intercept = false;
+ for (int i = 0; i < ADBLOCK_ENTRY_COUNT; i++) {
@@ -532,19 +532,22 @@ new file mode 100644
+ bool check =
+ (!intercept && ((entry->flags & ADBLOCK_FLAG_EXCEPTION) == 0)) ||
+ (intercept && ((entry->flags & ADBLOCK_FLAG_EXCEPTION) != 0));
+
+ if (!check)
+ continue;
+
+ // first check for domain matches, a quick branch out if matching
+ if (!url_match_domain(entry, origin_host))
+ if (0 == url_match_domain(entry, origin_host)) {
+ continue;
+ }
+ // fallthrough with values 3 (undetermined / no domain options) or 1 (matched)
+
+ // check on the URL matcher
+ if (!url_matches(c_url, c_url_sep, c_url_lower, c_url_lower_sep, entry))
+ continue;
+
+ // finally check first/third-party
+ if (!url_match_party(entry, url, origin_host, checked_fp, fp))
+ if (0 == url_match_party(entry, url, origin_host, fp))
+ continue;
+
+#ifdef ADBLOCK_LOG
@@ -566,12 +569,12 @@ new file mode 100644
+
+ if (intercept) {
+#ifdef ADBLOCK_LOG
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "blocked");
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "blocked (fp=%d)", fp);
+#endif
+ return 1;
+ }
+#ifdef ADBLOCK_LOG
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "pass");
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "pass (fp=%d)", fp);
+#endif
+ }
+ return 0;
@@ -12,9 +12,9 @@ approach to change color components.
---
.../modules/webgl/webgl_debug_renderer_info.cc | 4 +-
.../platform/graphics/image_data_buffer.cc | 5 +
.../platform/graphics/static_bitmap_image.cc | 153 +++++++++++++++++++++
.../platform/graphics/static_bitmap_image.cc | 154 +++++++++++++++++++++
.../platform/graphics/static_bitmap_image.h | 2 +
4 files changed, 162 insertions(+), 2 deletions(-)
4 files changed, 163 insertions(+), 2 deletions(-)
diff --git a/third_party/blink/renderer/modules/webgl/webgl_debug_renderer_info.cc b/third_party/blink/renderer/modules/webgl/webgl_debug_renderer_info.cc
--- a/third_party/blink/renderer/modules/webgl/webgl_debug_renderer_info.cc
@@ -58,15 +58,16 @@ diff --git a/third_party/blink/renderer/platform/graphics/image_data_buffer.cc b
diff --git a/third_party/blink/renderer/platform/graphics/static_bitmap_image.cc b/third_party/blink/renderer/platform/graphics/static_bitmap_image.cc
--- a/third_party/blink/renderer/platform/graphics/static_bitmap_image.cc
+++ b/third_party/blink/renderer/platform/graphics/static_bitmap_image.cc
@@ -4,6 +4,7 @@
@@ -4,6 +4,8 @@
#include "third_party/blink/renderer/platform/graphics/static_bitmap_image.h"
+#include "base/rand_util.h"
+#include "base/logging.h"
#include "gpu/command_buffer/client/gles2_interface.h"
#include "third_party/blink/renderer/platform/graphics/accelerated_static_bitmap_image.h"
#include "third_party/blink/renderer/platform/graphics/graphics_context.h"
@@ -15,6 +16,7 @@
@@ -15,6 +17,7 @@
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkImage.h"
#include "third_party/skia/include/core/SkPaint.h"
@@ -74,7 +75,7 @@ diff --git a/third_party/blink/renderer/platform/graphics/static_bitmap_image.cc
#include "third_party/skia/include/gpu/GrContext.h"
namespace blink {
@@ -161,10 +163,161 @@ bool StaticBitmapImage::ConvertToArrayBufferContents(
@@ -161,10 +164,161 @@ bool StaticBitmapImage::ConvertToArrayBufferContents(
DCHECK(read_pixels_successful ||
!sk_image->bounds().intersect(SkIRect::MakeXYWH(
rect.X(), rect.Y(), info.width(), info.height())));
@@ -112,7 +113,7 @@ diff --git a/third_party/blink/renderer/platform/graphics/static_bitmap_image.cc
+ auto colorType = info.colorType();
+ auto fRowBytes = info.minRowBytes(); // stride
+
+ LOG(DEBUG) << "BRM: ShuffleSubchannelColorData() w=" << w << " h=" << h << " colorType=" << colorType << " fRowBytes=" << fRowBytes;
+ DLOG(INFO) << "BRM: ShuffleSubchannelColorData() w=" << w << " h=" << h << " colorType=" << colorType << " fRowBytes=" << fRowBytes;
+
+ // second random number (for y/height)
+ double shuffleY = base::RandDouble();
@@ -212,7 +213,7 @@ diff --git a/third_party/blink/renderer/platform/graphics/static_bitmap_image.cc
+ break;
+ default:
+ // the remaining formats are not expected to be used in Chromium
+ LOG(INFO) << "BRM: ShuffleSubchannelColorData(): Ignoring pixel format";
+ LOG(WARNING) << "BRM: ShuffleSubchannelColorData(): Ignoring pixel format";
+ return;
+ }
+