Compare commits

...
Author SHA1 Message Date
csagan5 ec5be6c048 Release 66.0.3359.161 2018-05-08 21:51:11 +02:00
csagan5 67651fbd75 Do not use special release svg 2018-05-05 20:12:38 +02:00
csagan5 6b758bfe0c Added patches for previous release 2018-05-05 20:11:18 +02:00
csagan5 49ae827092 Release 66.0.3359.148 2018-05-05 00:51:00 +02:00
csagan5 01ad976b53 Release 65.0.3325.230 2018-04-21 22:39:52 +02:00
csagan5 38a672a1ca Updated CHANGELOG 2018-04-12 09:47:34 +02:00
csagan5 a723e0e77d Release 65.0.3325.218 2018-04-12 09:38:58 +02:00
CarlandGitHub 3abb1ad2a3 Mention anti-fingerprinting mitigations 2018-04-05 10:54:31 +02:00
csagan5 d7e8ac9d86 Add latest AdBlock filters 2018-04-01 12:05:30 +02:00
csagan5 284c419d01 Release 65.0.3325.204 2018-04-01 11:43:20 +02:00
csagan5 2dca759091 Publish patches for next release 2018-04-01 11:29:50 +02:00
csagan5 11cebfadc5 Release 65.0.3325.198 2018-03-29 09:20:10 +02:00
csagan5 e4e56ed69c Updated README, added Goals 2018-03-28 18:12:04 +02:00
CarlandGitHub 7dcc27cb5e Mention SystemWebView 2018-03-28 01:43:32 +02:00
38 changed files with 102836 additions and 64081 deletions
+29 -2
View File
@@ -1,6 +1,33 @@
# 66.0.3359.161
* updated AdBlock filters
# 66.0.3359.148
* disable permanently all custom tab intents (https://github.com/bromite/bromite/issues/17)
* updated AdBlock filters
* reduce randomisation for client rects from 5% to 3%
# 65.0.3325.230
* fixed permission to access Google account issue (https://github.com/bromite/bromite/issues/11)
* updated AdBlock filters
# 65.0.3325.218
* always set WideVine version
* updated AdBlock filters
# 65.0.3325.204
* add menu option to toggle global Javascript preferences setting (https://github.com/bromite/bromite/issues/37)
* add fingeprinting mitigation for getClientRects, getBoundingClientRect
* set audio latency to fixed number
* updated AdBlock filters
# 65.0.3325.198
* re-landed support for third-party AdBlock filters
* completed patches cleanup
* updated AdBlock filters
# 65.0.3325.190
* block some Canvas and AudioBuffer APIs mostly used for fingerprinting
* updated adblock filters
* block some Canvas and AudioBuffer APIs mostly used for fingerprinting (https://github.com/bromite/bromite/issues/15)
* updated AdBlock filters
# 65.0.3325.176
* block plugins enumeration API
+20 -9
View File
@@ -1,6 +1,6 @@
# Bromite - Take back your browser
[![GitHub release][version-image]][version-url] [![license][license-image]][license-url]
<img src="https://www.bromite.org/release.svg" alt="current Bromite release" title="current Bromite release" /> [![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" />
@@ -12,6 +12,11 @@ See [open issues](https://github.com/bromite/bromite/issues) for the development
<img src="https://www.bromite.org/bromite_bromite_gh_downloads.svg" alt="downloads on Github" title="downloads on Github" /> <img src="https://www.bromite.org/bromite_bromite_xda_downloads.svg" alt="downloads on XDA Labs" title="downloads on XDA Labs" />
# Goals
Bromite aims at providing a no-clutter browsing experience without privacy-invasive features and with the addition of a fast ad-blocking engine.
Minimal UI changes are applied to help curbing the idea of "browser as an advertisement platform".
# Donate
Please donate to support development of Bromite and the costs for the build system.
@@ -30,10 +35,13 @@ ETH donations address: `0xf47ff39223d828f99fec5ab53bd068c5c0522042`
No.
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.
## What is the SystemWebView?
It is the core component of Android for all web page visualizations. For example when you access a new wifi network and need to activate it, that is using the SystemWebView. If you do not know what it is then you do not need to install it.
## Does Bromite require root?
No.
## Q. Can you add dark mode/some cool themes?
## Can you add dark mode/some cool themes?
No.
Bromite is about adblocking and privacy.
@@ -43,27 +51,30 @@ We cannot add add-ons to Bromite (merely some features) and anyway HTTPS everywh
# Features
* adblocking (currently baked-in, no configuration options available)
* baked-in adblock engine with filters from EasyList, EasyPrivacy and others
* remove click-tracking and AMP from Google search results
* allow youtube/vimeo videos to play in background
* allow videos to play in background
* [StartPage](https://startpage.com/) search engine
* [DuckDuckGo](https://duckduckgo.com/) search engine
* [Qwant](https://www.qwant.com/) search engine
* Google search engines English-only with reduced tracking
* Google search engine English-only with reduced tracking
* privacy enhancement patches from Inox patchset, ungoogled-chromium and Iridium projects
* removed webRTC and applied other anti-fingerprinting mitigations
* webRTC, canvas, audio and other anti-fingerprinting mitigations
* all codecs included (proprietary, open H.264 etc.)
* built with official optimizations
# 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).
All built versions are available as [releases](https://github.com/bromite/bromite/releases).
Each tag corresponds to a Chromium release tag.
Bromite is currently built for ARM, ARM64 and x86 and for the Android SDKs versions 16 and 21
Additionally, SystemWebView, Monochrome and the vanilla Chromium builds are provided.
# How to build
The [bromite main repository](https://github.com/bromite/bromite) contains tags for each corresponding Chromium release (see https://chromium.googlesource.com/chromium/src.git).
The [Bromite main repository](https://github.com/bromite/bromite) contains tags for each corresponding Chromium release (see https://chromium.googlesource.com/chromium/src.git).
Please refer to [official Chromium build documentation](https://www.chromium.org/developers/how-tos/get-the-code) to get started on how to build Chromium; if you can build Chromium for Android, you can build Bromite.
@@ -74,7 +85,7 @@ Please refer to [official Chromium build documentation](https://www.chromium.org
* [Iridium project](https://github.com/iridium-browser) for some patches (taken from above ungoogled-chromium)
* [Inox patchset](https://github.com/gcarq/inox-patchset) for some patches (taken from above ungoogled-chromium)
* nochromo for the original adblock patch
* AdBlock Plus, uBlock, EasyList and EasyPrivacy for the compilation of original adblock patch
* AdBlock Plus, uBlock, EasyList and EasyPrivacy for the filters included
# License
File diff suppressed because one or more lines are too long
@@ -10,7 +10,7 @@ author: Chad Miller <chad.miller@canonical.com>
diff --git a/components/content_settings/core/browser/cookie_settings.cc b/components/content_settings/core/browser/cookie_settings.cc
--- a/components/content_settings/core/browser/cookie_settings.cc
+++ b/components/content_settings/core/browser/cookie_settings.cc
@@ -88,7 +88,7 @@ void CookieSettings::GetCookieSettings(
@@ -100,7 +100,7 @@ void CookieSettings::GetCookieSettings(
void CookieSettings::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(
+4 -4
View File
@@ -21,8 +21,8 @@ diff --git a/components/component_updater/configurator_impl.cc b/components/comp
// If there is an element of |vec| of the form |test|=.*, returns the right-
// hand side of that assignment. Otherwise, returns an empty string.
@@ -89,8 +91,7 @@ ConfiguratorImpl::ConfiguratorImpl(
fast_update_(false),
@@ -86,8 +88,7 @@ ConfiguratorImpl::ConfiguratorImpl(const base::CommandLine* cmdline,
: fast_update_(false),
pings_enabled_(false),
deltas_enabled_(false),
- background_downloads_enabled_(false),
@@ -31,7 +31,7 @@ diff --git a/components/component_updater/configurator_impl.cc b/components/comp
// Parse comma-delimited debug flags.
std::vector<std::string> switch_values = base::SplitString(
cmdline->GetSwitchValueASCII(switches::kComponentUpdater), ",",
@@ -138,22 +139,6 @@ int ConfiguratorImpl::UpdateDelay() const {
@@ -135,22 +136,6 @@ int ConfiguratorImpl::UpdateDelay() const {
std::vector<GURL> ConfiguratorImpl::UpdateUrl() const {
std::vector<GURL> urls;
@@ -57,7 +57,7 @@ diff --git a/components/component_updater/configurator_impl.cc b/components/comp
diff --git a/components/component_updater/configurator_impl.h b/components/component_updater/configurator_impl.h
--- a/components/component_updater/configurator_impl.h
+++ b/components/component_updater/configurator_impl.h
@@ -98,7 +98,6 @@ class ConfiguratorImpl {
@@ -89,7 +89,6 @@ class ConfiguratorImpl {
bool pings_enabled_;
bool deltas_enabled_;
bool background_downloads_enabled_;
@@ -12,7 +12,7 @@ author: Jan Engelhardt <jengelh@inai.de>
diff --git a/components/content_settings/core/browser/content_settings_registry.cc b/components/content_settings/core/browser/content_settings_registry.cc
--- a/components/content_settings/core/browser/content_settings_registry.cc
+++ b/components/content_settings/core/browser/content_settings_registry.cc
@@ -118,7 +118,7 @@ void ContentSettingsRegistry::Init() {
@@ -117,7 +117,7 @@ void ContentSettingsRegistry::Init() {
// WARNING: The string names of the permissions passed in below are used to
// generate preference names and should never be changed!
+1 -1
View File
@@ -32,7 +32,7 @@ diff --git a/net/cert/ev_root_ca_metadata.cc b/net/cert/ev_root_ca_metadata.cc
// AC Camerfirma S.A. Chambers of Commerce Root - 2008
// https://www.camerfirma.com
{
@@ -708,7 +718,9 @@ static const EVMetadata ev_root_ca_metadata[] = {
@@ -748,7 +758,9 @@ static const EVMetadata ev_root_ca_metadata[] = {
0xd2, 0x09, 0xb7, 0x37, 0xcb, 0xe2, 0xc1, 0x8c, 0xfb, 0x2c, 0x10,
0xc0, 0xff, 0x0b, 0xcf, 0x0d, 0x32, 0x86, 0xfc, 0x1a, 0xa2}},
{"2.16.840.1.114404.1.1.2.4.1", ""},
+13 -13
View File
@@ -36,27 +36,27 @@ diff --git a/chrome/browser/background/background_mode_manager.cc b/chrome/brows
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -858,7 +858,7 @@ void ChromeContentBrowserClient::RegisterLocalStatePrefs(
@@ -880,7 +880,7 @@ void ChromeContentBrowserClient::RegisterLocalStatePrefs(
void ChromeContentBrowserClient::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(prefs::kDisable3DAPIs, false);
- registry->RegisterBooleanPref(prefs::kEnableHyperlinkAuditing, true);
+ registry->RegisterBooleanPref(prefs::kEnableHyperlinkAuditing, false);
registry->RegisterListPref(prefs::kEnableDeprecatedWebPlatformFeatures);
}
// Register user prefs for mapping SitePerProcess and IsolateOrigins in
// user policy in addition to the same named ones in Local State (which are
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -620,7 +620,7 @@ void IOThread::RegisterPrefs(PrefRegistrySimple* registry) {
@@ -642,7 +642,7 @@ void IOThread::RegisterPrefs(PrefRegistrySimple* registry) {
std::string());
registry->RegisterBooleanPref(prefs::kEnableReferrers, true);
data_reduction_proxy::RegisterPrefs(registry);
- registry->RegisterBooleanPref(prefs::kBuiltInDnsClientEnabled, true);
+ registry->RegisterBooleanPref(prefs::kBuiltInDnsClientEnabled, false);
registry->RegisterListPref(prefs::kDnsOverHttpsServers);
registry->RegisterListPref(prefs::kDnsOverHttpsServerMethods);
registry->RegisterBooleanPref(prefs::kQuickCheckEnabled, true);
registry->RegisterBooleanPref(prefs::kPacHttpsUrlStrippingEnabled, true);
#if defined(OS_POSIX)
diff --git a/chrome/browser/net/prediction_options.cc b/chrome/browser/net/prediction_options.cc
--- a/chrome/browser/net/prediction_options.cc
+++ b/chrome/browser/net/prediction_options.cc
@@ -108,7 +108,7 @@ diff --git a/chrome/browser/resources/settings/reset_page/reset_profile_dialog.h
diff --git a/chrome/browser/signin/signin_promo.cc b/chrome/browser/signin/signin_promo.cc
--- a/chrome/browser/signin/signin_promo.cc
+++ b/chrome/browser/signin/signin_promo.cc
@@ -391,8 +391,8 @@ void ForceWebBasedSigninFlowForTesting(bool force) {
@@ -384,8 +384,8 @@ void ForceWebBasedSigninFlowForTesting(bool force) {
void RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterIntegerPref(prefs::kSignInPromoStartupCount, 0);
@@ -117,12 +117,12 @@ diff --git a/chrome/browser/signin/signin_promo.cc b/chrome/browser/signin/signi
+ registry->RegisterBooleanPref(prefs::kSignInPromoUserSkipped, true);
+ registry->RegisterBooleanPref(prefs::kSignInPromoShowOnFirstRunAllowed, false);
registry->RegisterBooleanPref(prefs::kSignInPromoShowNTPBubble, false);
registry->RegisterIntegerPref(prefs::kDiceSigninUserMenuPromoCount, 0);
}
diff --git a/chrome/browser/ui/browser_ui_prefs.cc b/chrome/browser/ui/browser_ui_prefs.cc
--- a/chrome/browser/ui/browser_ui_prefs.cc
+++ b/chrome/browser/ui/browser_ui_prefs.cc
@@ -59,11 +59,11 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) {
@@ -65,11 +65,11 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(prefs::kWebAppCreateInAppsMenu, true);
registry->RegisterBooleanPref(prefs::kWebAppCreateInQuickLaunchBar, true);
registry->RegisterBooleanPref(
@@ -151,7 +151,7 @@ diff --git a/chrome/browser/ui/navigation_correction_tab_observer.cc b/chrome/br
diff --git a/chrome/browser/ui/webui/local_discovery/local_discovery_ui.cc b/chrome/browser/ui/webui/local_discovery/local_discovery_ui.cc
--- a/chrome/browser/ui/webui/local_discovery/local_discovery_ui.cc
+++ b/chrome/browser/ui/webui/local_discovery/local_discovery_ui.cc
@@ -144,10 +144,6 @@ void LocalDiscoveryUI::RegisterProfilePrefs(
@@ -143,10 +143,6 @@ void LocalDiscoveryUI::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(
prefs::kLocalDiscoveryNotificationsEnabled,
@@ -177,7 +177,7 @@ diff --git a/chrome/service/cloud_print/connector_settings.cc b/chrome/service/c
diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc
--- a/components/autofill/core/browser/autofill_manager.cc
+++ b/components/autofill/core/browser/autofill_manager.cc
@@ -216,7 +216,7 @@ void AutofillManager::RegisterProfilePrefs(
@@ -215,7 +215,7 @@ void AutofillManager::RegisterProfilePrefs(
registry->RegisterIntegerPref(
prefs::kAutofillCreditCardSigninPromoImpressionCount, 0);
registry->RegisterBooleanPref(
@@ -207,7 +207,7 @@ diff --git a/components/bookmarks/browser/bookmark_utils.cc b/components/bookmar
diff --git a/components/safe_browsing/common/safe_browsing_prefs.cc b/components/safe_browsing/common/safe_browsing_prefs.cc
--- a/components/safe_browsing/common/safe_browsing_prefs.cc
+++ b/components/safe_browsing/common/safe_browsing_prefs.cc
@@ -334,9 +334,9 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) {
@@ -370,9 +370,9 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) {
registry->RegisterBooleanPref(
prefs::kSafeBrowsingSawInterstitialScoutReporting, false);
registry->RegisterBooleanPref(
@@ -222,7 +222,7 @@ diff --git a/components/safe_browsing/common/safe_browsing_prefs.cc b/components
diff --git a/extensions/common/extension.cc b/extensions/common/extension.cc
--- a/extensions/common/extension.cc
+++ b/extensions/common/extension.cc
@@ -344,14 +344,6 @@ bool Extension::ShouldDisplayInExtensionSettings() const {
@@ -330,14 +330,6 @@ bool Extension::ShouldDisplayInExtensionSettings() const {
if (is_theme())
return false;
@@ -9,7 +9,7 @@ Subject: Do not store passwords by default
diff --git a/components/password_manager/core/browser/password_manager.cc b/components/password_manager/core/browser/password_manager.cc
--- a/components/password_manager/core/browser/password_manager.cc
+++ b/components/password_manager/core/browser/password_manager.cc
@@ -236,10 +236,10 @@ PasswordFormManager* FindMatchedManager(
@@ -244,10 +244,10 @@ PasswordFormManager* FindMatchedManager(
void PasswordManager::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(
@@ -9,8 +9,8 @@ Subject: Disable NTP remote suggestions by default
diff --git a/components/ntp_snippets/features.cc b/components/ntp_snippets/features.cc
--- a/components/ntp_snippets/features.cc
+++ b/components/ntp_snippets/features.cc
@@ -37,16 +37,16 @@ const base::Feature* const kAllFeatures[] = {
nullptr};
@@ -41,16 +41,16 @@ const base::Feature kArticleSuggestionsExpandableHeader{
"NTPArticleSuggestionsExpandableHeader", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kArticleSuggestionsFeature{
- "NTPArticleSuggestions", base::FEATURE_ENABLED_BY_DEFAULT};
@@ -9,7 +9,7 @@ Subject: Disable WebRTC by default
diff --git a/chrome/browser/ui/browser_ui_prefs.cc b/chrome/browser/ui/browser_ui_prefs.cc
--- a/chrome/browser/ui/browser_ui_prefs.cc
+++ b/chrome/browser/ui/browser_ui_prefs.cc
@@ -78,10 +78,10 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) {
@@ -84,10 +84,10 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) {
#endif
#if BUILDFLAG(ENABLE_WEBRTC)
// TODO(guoweis): Remove next 2 options at M50.
@@ -3,15 +3,15 @@ Date: Sun, 26 Nov 2017 22:51:43 +0100
Subject: Skip the first run and metrics
---
.../chrome/browser/firstrun/FirstRunStatus.java | 11 +++++------
.../chrome/browser/firstrun/FirstRunStatus.java | 8 ++++----
.../chrome/browser/firstrun/FirstRunUtils.java | 16 ++++++----------
.../browser/firstrun/ToSAndUMAFirstRunFragment.java | 18 ++++++------------
3 files changed, 17 insertions(+), 28 deletions(-)
3 files changed, 16 insertions(+), 26 deletions(-)
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunStatus.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunStatus.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunStatus.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunStatus.java
@@ -36,12 +36,11 @@ public class FirstRunStatus {
@@ -36,11 +36,11 @@ public class FirstRunStatus {
* includes ToS and Sign In pages if necessary.
*/
public static boolean getFirstRunFlowComplete() {
@@ -21,20 +21,12 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstR
+ if (!complete) {
+ setFirstRunFlowComplete(true);
}
- return CommandLine.isInitialized()
- && CommandLine.getInstance().hasSwitch(
- ChromeSwitches.FORCE_FIRST_RUN_FLOW_COMPLETE_FOR_TESTING);
- return CommandLine.getInstance().hasSwitch(
- ChromeSwitches.FORCE_FIRST_RUN_FLOW_COMPLETE_FOR_TESTING);
+ return true;
}
/**
@@ -77,4 +76,4 @@ public class FirstRunStatus {
return ContextUtils.getAppSharedPreferences().getBoolean(
LIGHTWEIGHT_FIRST_RUN_FLOW_COMPLETE, false);
}
-}
\ No newline at end of file
+}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunUtils.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunUtils.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunUtils.java
@@ -9,9 +9,9 @@ Subject: Fix crash when accessing page info / site settings
diff --git a/chrome/browser/permissions/permission_manager.cc b/chrome/browser/permissions/permission_manager.cc
--- a/chrome/browser/permissions/permission_manager.cc
+++ b/chrome/browser/permissions/permission_manager.cc
@@ -601,6 +601,9 @@ PermissionResult PermissionManager::GetPermissionStatusHelper(
const GURL& embedding_origin) {
GURL canonical_requesting_origin = GetCanonicalOrigin(requesting_origin);
@@ -623,6 +623,9 @@ PermissionResult PermissionManager::GetPermissionStatusHelper(
GURL canonical_requesting_origin =
GetCanonicalOrigin(requesting_origin, embedding_origin);
PermissionContextBase* context = GetPermissionContext(permission);
+ if (context == nullptr) {
+ return PermissionResult(CONTENT_SETTING_BLOCK, PermissionStatusSource::UNSPECIFIED);
@@ -12,7 +12,7 @@ Limit threads auto-detect only for iOS
diff --git a/content/renderer/media_recorder/h264_encoder.cc b/content/renderer/media_recorder/h264_encoder.cc
--- a/content/renderer/media_recorder/h264_encoder.cc
+++ b/content/renderer/media_recorder/h264_encoder.cc
@@ -146,11 +146,11 @@ void H264Encoder::ConfigureEncoderOnEncodingTaskRunner(const gfx::Size& size) {
@@ -149,11 +149,11 @@ void H264Encoder::ConfigureEncoderOnEncodingTaskRunner(const gfx::Size& size) {
init_params.iRCMode = RC_OFF_MODE;
}
@@ -12,7 +12,7 @@ Subject: Cure AMP and tracking from search results
diff --git a/third_party/WebKit/Source/core/dom/BUILD.gn b/third_party/WebKit/Source/core/dom/BUILD.gn
--- a/third_party/WebKit/Source/core/dom/BUILD.gn
+++ b/third_party/WebKit/Source/core/dom/BUILD.gn
@@ -296,6 +296,7 @@ blink_core_sources("dom") {
@@ -301,6 +301,7 @@ blink_core_sources("dom") {
"events/TreeScopeEventContext.h",
"events/WindowEventContext.cpp",
"events/WindowEventContext.h",
@@ -31,7 +31,7 @@ diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKi
#include "platform/CrossThreadFunctional.h"
#include "platform/DateComponents.h"
#include "platform/EventDispatchForbiddenScope.h"
@@ -5858,8 +5859,24 @@ void Document::FinishedParsing() {
@@ -5804,8 +5805,24 @@ void Document::FinishedParsing() {
fetcher_->ClearResourcesFromPreviousFetcher();
}
@@ -14,7 +14,7 @@ Original Javascript code by timdream
diff --git a/third_party/WebKit/Source/core/dom/BUILD.gn b/third_party/WebKit/Source/core/dom/BUILD.gn
--- a/third_party/WebKit/Source/core/dom/BUILD.gn
+++ b/third_party/WebKit/Source/core/dom/BUILD.gn
@@ -297,6 +297,7 @@ blink_core_sources("dom") {
@@ -302,6 +302,7 @@ blink_core_sources("dom") {
"events/WindowEventContext.cpp",
"events/WindowEventContext.h",
"extensions/dont-track-me.h",
@@ -33,7 +33,7 @@ diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKi
#include "platform/CrossThreadFunctional.h"
#include "platform/DateComponents.h"
#include "platform/EventDispatchForbiddenScope.h"
@@ -5866,17 +5867,25 @@ void Document::FinishedParsing() {
@@ -5812,17 +5813,25 @@ void Document::FinishedParsing() {
// determine whether this is a Google search results page
const SecurityOrigin *origin = GetSecurityOrigin();
@@ -23,7 +23,7 @@ diff --git a/chrome/browser/ui/chrome_pages.cc b/chrome/browser/ui/chrome_pages.
// Shows either the help app or the appropriate help page for |source|. If
// |browser| is NULL and the help page is used (vs the app), the help page is
// shown in the last active browser. If there is no such browser, a new browser
@@ -386,6 +380,7 @@ void ShowSearchEngineSettings(Browser* browser) {
@@ -396,6 +390,7 @@ void ShowSearchEngineSettings(Browser* browser) {
#if !defined(OS_ANDROID)
void ShowBrowserSignin(Browser* browser,
signin_metrics::AccessPoint access_point) {
@@ -31,7 +31,7 @@ diff --git a/chrome/browser/ui/chrome_pages.cc b/chrome/browser/ui/chrome_pages.
Profile* original_profile = browser->profile()->GetOriginalProfile();
SigninManagerBase* manager =
SigninManagerFactory::GetForProfile(original_profile);
@@ -426,6 +421,7 @@ void ShowBrowserSignin(Browser* browser,
@@ -436,6 +431,7 @@ void ShowBrowserSignin(Browser* browser,
false));
DCHECK_GT(browser->tab_strip_model()->count(), 0);
}
@@ -3,13 +3,13 @@ Date: Mon, 12 Feb 2018 21:21:36 +0100
Subject: ungoogled-chromium: Disable webRTC log uploader
---
chrome/browser/media/webrtc/webrtc_log_uploader.cc | 62 ++--------------------
1 file changed, 4 insertions(+), 58 deletions(-)
chrome/browser/media/webrtc/webrtc_log_uploader.cc | 28 ++++------------------
1 file changed, 4 insertions(+), 24 deletions(-)
diff --git a/chrome/browser/media/webrtc/webrtc_log_uploader.cc b/chrome/browser/media/webrtc/webrtc_log_uploader.cc
--- a/chrome/browser/media/webrtc/webrtc_log_uploader.cc
+++ b/chrome/browser/media/webrtc/webrtc_log_uploader.cc
@@ -115,30 +115,10 @@ void WebRtcLogUploader::LoggingStoppedDoUpload(
@@ -115,30 +115,7 @@ void WebRtcLogUploader::LoggingStoppedDoUpload(
DCHECK(meta_data.get());
DCHECK(!upload_done_data.log_path.empty());
@@ -18,8 +18,8 @@ diff --git a/chrome/browser/media/webrtc/webrtc_log_uploader.cc b/chrome/browser
-
- std::string local_log_id;
-
if (base::PathExists(upload_done_data.log_path)) {
WebRtcLogUtil::DeleteOldWebRtcLogFiles(upload_done_data.log_path);
- if (base::PathExists(upload_done_data.log_path)) {
- webrtc_logging::DeleteOldWebRtcLogFiles(upload_done_data.log_path);
-
- local_log_id = base::NumberToString(base::Time::Now().ToDoubleT());
- base::FilePath log_file_path =
@@ -28,10 +28,10 @@ diff --git a/chrome/browser/media/webrtc/webrtc_log_uploader.cc b/chrome/browser
- WriteCompressedLogToFile(compressed_log, log_file_path);
-
- base::FilePath log_list_path =
- WebRtcLogList::GetWebRtcLogListFileForDirectory(
- webrtc_logging::LogList::GetWebRtcLogListFileForDirectory(
- upload_done_data.log_path);
- AddLocallyStoredLogInfoToUploadListFile(log_list_path, local_log_id);
}
- }
-
- WebRtcLogUploadDoneData upload_done_data_with_log_id = upload_done_data;
- upload_done_data_with_log_id.local_log_id = local_log_id;
@@ -41,7 +41,7 @@ diff --git a/chrome/browser/media/webrtc/webrtc_log_uploader.cc b/chrome/browser
}
void WebRtcLogUploader::PrepareMultipartPostData(
@@ -149,6 +129,9 @@ void WebRtcLogUploader::PrepareMultipartPostData(
@@ -149,6 +126,9 @@ void WebRtcLogUploader::PrepareMultipartPostData(
DCHECK(!compressed_log.empty());
DCHECK(meta_data.get());
@@ -51,50 +51,6 @@ diff --git a/chrome/browser/media/webrtc/webrtc_log_uploader.cc b/chrome/browser
std::unique_ptr<std::string> post_data(new std::string());
SetupMultipart(post_data.get(),
compressed_log,
@@ -237,43 +220,6 @@ void WebRtcLogUploader::LoggingStoppedDoStore(
WebRtcLogUtil::DeleteOldWebRtcLogFiles(log_paths.log_path);
- base::FilePath log_list_path =
- WebRtcLogList::GetWebRtcLogListFileForDirectory(log_paths.log_path);
-
- // Store the native log with a ".gz" extension.
- std::string compressed_log;
- CompressLog(&compressed_log, log_buffer.get());
- base::FilePath native_log_path = log_paths.log_path.AppendASCII(log_id)
- .AddExtension(FILE_PATH_LITERAL(".gz"));
- WriteCompressedLogToFile(compressed_log, native_log_path);
- AddLocallyStoredLogInfoToUploadListFile(log_list_path, log_id);
-
- // Move the rtp dump files to the log directory with a name of
- // <log id>.rtp_[in|out].
- if (!log_paths.incoming_rtp_dump.empty()) {
- base::FilePath rtp_path = log_paths.log_path.AppendASCII(log_id)
- .AddExtension(FILE_PATH_LITERAL(".rtp_in"));
- base::Move(log_paths.incoming_rtp_dump, rtp_path);
- }
-
- if (!log_paths.outgoing_rtp_dump.empty()) {
- base::FilePath rtp_path = log_paths.log_path.AppendASCII(log_id)
- .AddExtension(FILE_PATH_LITERAL(".rtp_out"));
- base::Move(log_paths.outgoing_rtp_dump, rtp_path);
- }
-
- if (meta_data.get() && !meta_data->empty()) {
- base::Pickle pickle;
- for (const auto& it : *meta_data.get()) {
- pickle.WriteString(it.first);
- pickle.WriteString(it.second);
- }
- base::FilePath meta_path = log_paths.log_path.AppendASCII(log_id)
- .AddExtension(FILE_PATH_LITERAL(".meta"));
- base::WriteFile(meta_path, static_cast<const char*>(pickle.data()),
- pickle.size());
- }
-
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
base::BindOnce(done_callback, true, ""));
--
2.7.4
@@ -5,13 +5,13 @@ Subject: ungoogled-chromium: Disable untraceable URLs
Disable additional URLs that are not caught by the "trk" scheme
---
chrome/browser/android/rlz/rlz_ping_handler.cc | 2 +-
chrome/browser/plugins/plugins_resource_service.cc | 2 +-
chrome/browser/plugins/plugins_resource_service.cc | 5 +----
chrome/browser/safe_browsing/client_side_model_loader.cc | 6 ++----
chrome/browser/safe_browsing/client_side_model_loader.h | 1 -
rlz/lib/financial_ping.cc | 4 ++--
rlz/lib/lib_values.cc | 1 -
rlz/lib/lib_values.h | 1 -
7 files changed, 6 insertions(+), 11 deletions(-)
7 files changed, 6 insertions(+), 14 deletions(-)
diff --git a/chrome/browser/android/rlz/rlz_ping_handler.cc b/chrome/browser/android/rlz/rlz_ping_handler.cc
--- a/chrome/browser/android/rlz/rlz_ping_handler.cc
@@ -28,7 +28,17 @@ diff --git a/chrome/browser/android/rlz/rlz_ping_handler.cc b/chrome/browser/and
diff --git a/chrome/browser/plugins/plugins_resource_service.cc b/chrome/browser/plugins/plugins_resource_service.cc
--- a/chrome/browser/plugins/plugins_resource_service.cc
+++ b/chrome/browser/plugins/plugins_resource_service.cc
@@ -68,7 +68,7 @@ GURL GetPluginsServerURL() {
@@ -52,9 +52,6 @@ const int kStartResourceFetchDelayMs = 60 * 1000;
// Delay between calls to update the cache 1 day and 2 minutes in testing mode.
const int kCacheUpdateDelayMs = 24 * 60 * 60 * 1000;
-const char kPluginsServerUrl[] =
- "https://www.gstatic.com/chrome/config/plugins_3/";
-
GURL GetPluginsServerURL() {
std::string filename;
#if defined(OS_WIN)
@@ -69,7 +66,7 @@ GURL GetPluginsServerURL() {
#error Unknown platform
#endif
@@ -14,7 +14,7 @@ Disables various detections of Google hosts and functionality specific to them
diff --git a/chrome/browser/page_load_metrics/page_load_metrics_util.cc b/chrome/browser/page_load_metrics/page_load_metrics_util.cc
--- a/chrome/browser/page_load_metrics/page_load_metrics_util.cc
+++ b/chrome/browser/page_load_metrics/page_load_metrics_util.cc
@@ -164,9 +164,7 @@ bool DidObserveLoadingBehaviorInAnyFrame(
@@ -169,9 +169,7 @@ bool DidObserveLoadingBehaviorInAnyFrame(
}
bool IsGoogleSearchHostname(const GURL& url) {
@@ -324,7 +324,7 @@ diff --git a/components/google/core/browser/google_util.cc b/components/google/c
diff --git a/components/search_engines/template_url.cc b/components/search_engines/template_url.cc
--- a/components/search_engines/template_url.cc
+++ b/components/search_engines/template_url.cc
@@ -455,11 +455,6 @@ base::string16 TemplateURLRef::SearchTermToString16(
@@ -510,11 +510,6 @@ base::string16 TemplateURLRef::SearchTermToString16(
bool TemplateURLRef::HasGoogleBaseURLs(
const SearchTermsData& search_terms_data) const {
ParseIfNecessary(search_terms_data);
@@ -10,7 +10,7 @@ Disable Google Cloud Messaging (GCM) client
diff --git a/components/gcm_driver/gcm_client_impl.cc b/components/gcm_driver/gcm_client_impl.cc
--- a/components/gcm_driver/gcm_client_impl.cc
+++ b/components/gcm_driver/gcm_client_impl.cc
@@ -481,6 +481,7 @@ void GCMClientImpl::StartGCM() {
@@ -502,6 +502,7 @@ void GCMClientImpl::StartGCM() {
}
void GCMClientImpl::InitializeMCSClient() {
@@ -18,7 +18,7 @@ diff --git a/components/gcm_driver/gcm_client_impl.cc b/components/gcm_driver/gc
std::vector<GURL> endpoints;
endpoints.push_back(gservices_settings_.GetMCSMainEndpoint());
GURL fallback_endpoint = gservices_settings_.GetMCSFallbackEndpoint();
@@ -678,6 +679,7 @@ void GCMClientImpl::RemoveHeartbeatInterval(const std::string& scope) {
@@ -699,6 +700,7 @@ void GCMClientImpl::RemoveHeartbeatInterval(const std::string& scope) {
}
void GCMClientImpl::StartCheckin() {
@@ -26,7 +26,7 @@ diff --git a/components/gcm_driver/gcm_client_impl.cc b/components/gcm_driver/gc
// Make sure no checkin is in progress.
if (checkin_request_.get())
return;
@@ -756,6 +758,7 @@ void GCMClientImpl::SetGServicesSettingsCallback(bool success) {
@@ -777,6 +779,7 @@ void GCMClientImpl::SetGServicesSettingsCallback(bool success) {
}
void GCMClientImpl::SchedulePeriodicCheckin() {
@@ -18,7 +18,7 @@ See also: https://github.com/Eloston/ungoogled-chromium/issues/104
diff --git a/chrome/browser/browser_resources.grd b/chrome/browser/browser_resources.grd
--- a/chrome/browser/browser_resources.grd
+++ b/chrome/browser/browser_resources.grd
@@ -307,7 +307,6 @@
@@ -299,7 +299,6 @@
<include name="IDR_INLINE_LOGIN_HTML" file="resources\inline_login\inline_login.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" />
<include name="IDR_INLINE_LOGIN_CSS" file="resources\inline_login\inline_login.css" flattenhtml="true" type="BINDATA" />
<include name="IDR_INLINE_LOGIN_JS" file="resources\inline_login\inline_login.js" flattenhtml="true" type="BINDATA" />
@@ -26,7 +26,7 @@ diff --git a/chrome/browser/browser_resources.grd b/chrome/browser/browser_resou
<include name="IDR_INSPECT_CSS" file="resources\inspect\inspect.css" flattenhtml="true" type="BINDATA" />
<include name="IDR_INSPECT_HTML" file="resources\inspect\inspect.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" />
<include name="IDR_INSPECT_JS" file="resources\inspect\inspect.js" flattenhtml="true" type="BINDATA" />
@@ -445,7 +444,6 @@
@@ -435,7 +434,6 @@
</if>
<include name="IDR_WEBSTORE_MANIFEST" file="resources\webstore_app\manifest.json" type="BINDATA" />
<include name="IDR_CRYPTOTOKEN_MANIFEST" file="resources\cryptotoken\manifest.json" type="BINDATA" />
@@ -19,7 +19,7 @@ Adds a menu item under "More tools" to clear the HTTP authentication cache on de
diff --git a/chrome/app/chrome_command_ids.h b/chrome/app/chrome_command_ids.h
--- a/chrome/app/chrome_command_ids.h
+++ b/chrome/app/chrome_command_ids.h
@@ -148,6 +148,7 @@
@@ -150,6 +150,7 @@
#define IDC_DEV_TOOLS_INSPECT 40023
#define IDC_UPGRADE_DIALOG 40024
#define IDC_VIEW_INCOMPATIBILITIES 40025
@@ -30,7 +30,7 @@ diff --git a/chrome/app/chrome_command_ids.h b/chrome/app/chrome_command_ids.h
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -1064,6 +1064,9 @@ are declared in build/common.gypi.
@@ -1050,6 +1050,9 @@ are declared in build/common.gypi.
<message name="IDS_CLEAR_BROWSING_DATA" desc="The text label for the menu item for clearing of browsing data">
&amp;Clear browsing data...
</message>
@@ -40,7 +40,7 @@ diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources
<message name="IDS_SHOW_DOWNLOADS" desc="The show downloads menu in the app menu">
&amp;Downloads
</message>
@@ -1102,6 +1105,9 @@ are declared in build/common.gypi.
@@ -1088,6 +1091,9 @@ are declared in build/common.gypi.
<message name="IDS_CLEAR_BROWSING_DATA" desc="In Title Case: The text label for the menu item for clearing of browsing data">
&amp;Clear Browsing Data...
</message>
@@ -53,7 +53,7 @@ diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources
diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc
--- a/chrome/browser/ui/browser_command_controller.cc
+++ b/chrome/browser/ui/browser_command_controller.cc
@@ -58,6 +58,9 @@
@@ -59,6 +59,9 @@
#include "extensions/browser/extension_system.h"
#include "printing/features/features.h"
#include "ui/events/keycodes/keyboard_codes.h"
@@ -63,7 +63,7 @@ diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui
#if defined(OS_MACOSX)
#include "chrome/browser/ui/browser_commands_mac.h"
@@ -625,6 +628,9 @@ bool BrowserCommandController::ExecuteCommandWithDisposition(
@@ -624,6 +627,9 @@ bool BrowserCommandController::ExecuteCommandWithDisposition(
case IDC_CLEAR_BROWSING_DATA:
ShowClearBrowsingDataDialog(browser_);
break;
@@ -73,7 +73,7 @@ diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui
case IDC_IMPORT_SETTINGS:
ShowImportDialog(browser_);
break;
@@ -867,6 +873,7 @@ void BrowserCommandController::InitCommandState() {
@@ -865,6 +871,7 @@ void BrowserCommandController::InitCommandState() {
!profile()->IsOffTheRecord());
command_updater_.UpdateCommandEnabled(IDC_CLEAR_BROWSING_DATA,
!guest_session);
@@ -157,7 +157,7 @@ diff --git a/net/http/http_auth_cache.h b/net/http/http_auth_cache.h
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml
--- a/tools/metrics/histograms/enums.xml
+++ b/tools/metrics/histograms/enums.xml
@@ -46154,6 +46154,7 @@ Called by update_traffic_annotation_histograms.py.-->
@@ -47004,6 +47004,7 @@ Called by update_traffic_annotation_histograms.py.-->
<int value="48" label="Open in Chrome"/>
<int value="49" label="Site Settings"/>
<int value="50" label="App Info"/>
@@ -168,7 +168,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
@@ -102544,6 +102544,7 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
@@ -104632,6 +104632,7 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
<suffix name="Overestimate"
label="Tracks when the compositor's estimates were too high and by how
much."/>
File diff suppressed because one or more lines are too long
@@ -0,0 +1,189 @@
From: NoChromo <nochromo@nochromo.com>
Date: Sun, 3 Apr 2016 12:44:50 +0800
Subject: url_request: hooks and ad url data
---
net/BUILD.gn | 2 +
net/url_request/nochromo_intercept.cc | 116 ++++++++++++++++++++++++++++++++++
net/url_request/nochromo_intercept.h | 13 ++++
net/url_request/url_request.cc | 4 ++
4 files changed, 135 insertions(+)
create mode 100644 net/url_request/nochromo_intercept.cc
create mode 100644 net/url_request/nochromo_intercept.h
diff --git a/net/BUILD.gn b/net/BUILD.gn
--- a/net/BUILD.gn
+++ b/net/BUILD.gn
@@ -1748,6 +1748,8 @@ component("net") {
"url_request/url_fetcher_response_writer.h",
"url_request/url_range_request_job.cc",
"url_request/url_range_request_job.h",
+ "url_request/nochromo_intercept.cc",
+ "url_request/nochromo_intercept.h",
"url_request/url_request.cc",
"url_request/url_request.h",
"url_request/url_request_context.cc",
diff --git a/net/url_request/nochromo_intercept.cc b/net/url_request/nochromo_intercept.cc
new file mode 100644
--- /dev/null
+++ b/net/url_request/nochromo_intercept.cc
@@ -0,0 +1,116 @@
+#include "url/gurl.h"
+#include "net/url_request/nochromo_entries.h"
+
+#include <android/log.h>
+
+namespace net {
+
+#define NOCHROMO_LOG 0
+#define NOCHROMO_LOG_MORE 0
+
+static char* strtolower(const char* str) {
+ int len = strlen(str);
+ char* ret = (char*)malloc(len + 1);
+ ret[len] = '\0';
+ for (int i = 0; i < len; i++) {
+ if ((65 <= str[i]) && (str[i] <= 90)) {
+ ret[i] = str[i] + 32;
+ } else {
+ ret[i] = str[i];
+ }
+ }
+ return ret;
+}
+
+static char* strtosep(const char* str) {
+ int len = strlen(str);
+ char* ret = (char*)malloc(len + 3);
+ ret[0] = '^';
+ ret[len + 1] = '^';
+ ret[len + 2] = '\0';
+ for (int i = 0; i < len; i++) {
+ if ((str[i] == ':') || (str[i] == '/') || (str[i] == '?') || (str[i] == '&') || (str[i] == '=')) {
+ ret[i + 1] = '^';
+ } else {
+ ret[i + 1] = str[i];
+ }
+ }
+ return ret;
+}
+
+int nochromo_intercept(const GURL& url) {
+ if (url.is_valid() && url.SchemeIsHTTPOrHTTPS()) {
+ const char* c_url = url.spec().c_str();
+ char* c_url_lower = strtolower(c_url);
+ char* c_url_sep = strtosep(c_url);
+ char* c_url_lower_sep = strtosep(c_url_lower);
+
+ if (NOCHROMO_LOG) __android_log_print(ANDROID_LOG_INFO, "NoChromo", "[%s]", c_url);
+
+ bool intercept = false;
+ for (int i = 0; i < NOCHROMO_ENTRY_COUNT; i++) {
+ nochromo_entry* entry = &NOCHROMO_ENTRIES[i];
+
+ // no use checking rules when we're intercepting, or exceptions when not
+ bool check =
+ (!intercept && ((entry->flags & NOCHROMO_FLAG_EXCEPTION) == 0)) ||
+ (intercept && ((entry->flags & NOCHROMO_FLAG_EXCEPTION) != 0));
+
+ if (check) {
+ bool match = false;
+
+ // select comparison string based on case and separator presence (separator takes some shortcuts)
+ bool match_case = ((entry->flags & NOCHROMO_FLAG_MATCH_CASE) != 0);
+ bool match_separator = ((entry->flags & NOCHROMO_FLAG_HAS_SEPARATOR) != 0);
+ const char* match_url = match_case ? (match_separator ? c_url_sep : c_url) : (match_separator ? c_url_lower_sep : c_url_lower);
+
+ if (NOCHROMO_LOG || NOCHROMO_LOG_MORE) __android_log_print(ANDROID_LOG_INFO, "NoChromo", "[case:%d][sep:%d][%s]", match_case, match_separator, match_url);
+
+ // check for all match parts at >= position of last match
+ const char* last = match_url;
+ for (int m = 0; m < entry->matchcount; m++) {
+ const char* pos = strstr(last, entry->matches[m]);
+ match = (pos != NULL);
+
+ if (NOCHROMO_LOG || NOCHROMO_LOG_MORE) __android_log_print(ANDROID_LOG_INFO, "NoChromo", "[%s][found:%d][match:%d]", entry->matches[m], pos == NULL ? 0 : 1, match ? 1 : 0);
+
+ // check if the url starts with the first match part
+ if (match && (m == 0) && ((entry->flags & NOCHROMO_FLAG_MATCH_BEGIN) != 0) && (pos != match_url)) match = false;
+
+ // check if the url ends with the last match part
+ if (match && (m == entry->matchcount - 1) && ((entry->flags & NOCHROMO_FLAG_MATCH_END) != 0) && (pos != &match_url[strlen(match_url) - strlen(entry->matches[m])])) match = false;
+
+ // check domain match
+ if (match && (m == 0) && ((entry->flags & NOCHROMO_FLAG_MATCH_DOMAIN) != 0) && (pos != match_url) && (pos[-1] != '^') && (pos[-1] != '.') && (pos[-1] != '/')) match = false;
+
+ // short circuit
+ if (!match) break;
+ }
+
+ if (match) {
+ if (NOCHROMO_LOG) {
+ if (!intercept) {
+ __android_log_print(ANDROID_LOG_INFO, "NoChromo", "--> intercept (%d) (%d)", i, entry->flags);
+ } else {
+ __android_log_print(ANDROID_LOG_INFO, "NoChromo", "--> pass (%d) (%d)", i, entry->flags);
+ }
+ }
+ intercept = !intercept;
+ }
+ }
+ }
+
+ free(c_url_sep);
+ free(c_url_lower);
+ free(c_url_lower_sep);
+
+ if (intercept) {
+ if (NOCHROMO_LOG) __android_log_print(ANDROID_LOG_INFO, "NoChromo", "intercepted!");
+ return 1;
+ }
+ if (NOCHROMO_LOG) __android_log_print(ANDROID_LOG_INFO, "NoChromo", "pass!");
+ }
+ return 0;
+}
+
+} // namespace net
\ No newline at end of file
diff --git a/net/url_request/nochromo_intercept.h b/net/url_request/nochromo_intercept.h
new file mode 100644
--- /dev/null
+++ b/net/url_request/nochromo_intercept.h
@@ -0,0 +1,13 @@
+#ifndef NET_URL_REQUEST_NOCHROMO_INTERCEPT_H_
+#define NET_URL_REQUEST_NOCHROMO_INTERCEPT_H_
+
+#include "url/gurl.h"
+
+namespace net {
+
+GURL nochromo_intercepted = GURL("http://127.0.0.1/");
+int nochromo_intercept(const GURL& url);
+
+} // namespace net
+
+#endif // NET_URL_REQUEST_NOCHROMO_INTERCEPT_H_
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
--- a/net/url_request/url_request.cc
+++ b/net/url_request/url_request.cc
@@ -43,6 +43,8 @@
#include "url/gurl.h"
#include "url/origin.h"
+#include "net/url_request/nochromo_intercept.h"
+
#if BUILDFLAG(ENABLE_REPORTING)
#include "net/network_error_logging/network_error_logging_service.h"
#include "net/reporting/reporting_service.h"
@@ -581,6 +583,8 @@ URLRequest::URLRequest(const GURL& url,
// Sanity check out environment.
DCHECK(base::ThreadTaskRunnerHandle::IsSet());
+ if (nochromo_intercept(url)) url_chain_.push_back(nochromo_intercepted);
+
context->url_requests()->insert(this);
net_log_.BeginEvent(
NetLogEventType::REQUEST_ALIVE,
--
2.7.4
+584
View File
@@ -0,0 +1,584 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Wed, 28 Mar 2018 15:55:11 +0200
Subject: Bromite adblock engine
Ported from NoChromo patch
Make interception testable
Add domain support
Re-land: third-party filters support
---
net/BUILD.gn | 9 +-
net/url_request/adblock_intercept.cc | 324 ++++++++++++++++++++++++++++++++++
net/url_request/adblock_intercept.h | 16 ++
net/url_request/nochromo_intercept.cc | 116 ------------
net/url_request/nochromo_intercept.h | 13 --
net/url_request/url_request.cc | 19 +-
6 files changed, 364 insertions(+), 133 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
delete mode 100644 net/url_request/nochromo_intercept.h
diff --git a/net/BUILD.gn b/net/BUILD.gn
--- a/net/BUILD.gn
+++ b/net/BUILD.gn
@@ -1748,8 +1748,6 @@ component("net") {
"url_request/url_fetcher_response_writer.h",
"url_request/url_range_request_job.cc",
"url_request/url_range_request_job.h",
- "url_request/nochromo_intercept.cc",
- "url_request/nochromo_intercept.h",
"url_request/url_request.cc",
"url_request/url_request.h",
"url_request/url_request_context.cc",
@@ -1810,6 +1808,13 @@ component("net") {
"//third_party/zlib",
]
+ if (is_android) {
+ sources += [
+ "url_request/adblock_intercept.cc",
+ "url_request/adblock_intercept.h"
+ ]
+ }
+
if (enable_reporting) {
sources += [
"network_error_logging/network_error_logging_delegate.cc",
diff --git a/net/url_request/adblock_intercept.cc b/net/url_request/adblock_intercept.cc
new file mode 100644
--- /dev/null
+++ b/net/url_request/adblock_intercept.cc
@@ -0,0 +1,324 @@
+#include "url/gurl.h"
+
+#ifdef ADB_TESTER
+#include <cstddef>
+#include <cstdlib>
+#include <string.h>
+
+#include "log.h"
+#include <tld.h>
+
+#else
+
+#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
+#include <android/log.h>
+
+#endif
+
+#include "net/url_request/adblock_entries.h"
+
+namespace net {
+
+const char *LOG_TAG = "Bromite";
+
+#ifdef ADB_TESTER
+int adblock_rules_count() { return ADBLOCK_ENTRY_COUNT; }
+#endif
+
+// True if the given canonical |host| is "[www.]<domain_in_lower_case>.<TLD>"
+// with a valid TLD. If |subdomain_permission| is ALLOW_SUBDOMAIN, we check
+// against host "*.<domain_in_lower_case>.<TLD>" instead. Will return the TLD
+// string in |tld|, if specified and the |host| can be parsed.
+static bool is_first_party(char *l_host, char *l_url_host) {
+ size_t tld_length;
+
+#ifdef ADB_TESTER
+ char *found_tld;
+
+ if (TLD_SUCCESS != tld_get_z(l_host, &found_tld))
+ return false;
+ tld_length = strlen(found_tld);
+ if (tld_length == 0)
+ return false;
+#else
+ tld_length = net::registry_controlled_domains::GetCanonicalHostRegistryLength(
+ l_host, net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES,
+ net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES);
+ if ((tld_length == 0) || (tld_length == std::string::npos))
+ return false;
+#endif
+
+ int len = strlen(l_host);
+ char *tld = l_host + len - tld_length;
+
+ // Removes any subdomain from origin host.
+ int i = len - tld_length - 2, top_i = i;
+ if (i < 0) {
+ return false;
+ }
+ char *domain = l_host;
+ for (; i >= 0; i--) {
+ if (l_host[i] == '.') {
+ int p_len = top_i - i;
+ // skip "co" in "co.uk", "org" in "org.uk"
+ if (p_len <= 3) {
+ tld -= p_len + 1;
+ continue;
+ }
+
+ // segment is long enough, accept it at as a domain
+ domain = l_host + i;
+ len -= i;
+ break;
+ }
+ }
+
+#ifdef ADBLOCK_LOG
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG,
+ "%s: extracted domain suffix: \"%s\" (TLD=\"%s\")",
+ l_host, domain, tld);
+#endif
+
+ // Check if supplied URL host matches, including the dot.
+ int b_len = strlen(l_url_host);
+ if (b_len < len) {
+ return false;
+ }
+ for (int i = 0; i < len; i++) {
+ if (l_url_host[b_len - 1 - i] != domain[len - 1 - i])
+ return false;
+ }
+
+ // pass with flying colors
+ return true;
+}
+
+static char *strtolower(const char *str) {
+ int len = strlen(str);
+ char *ret = (char *)malloc(len + 1);
+ ret[len] = '\0';
+ for (int i = 0; i < len; i++) {
+ if ((65 <= str[i]) && (str[i] <= 90)) {
+ ret[i] = str[i] + 32;
+ } else {
+ ret[i] = str[i];
+ }
+ }
+ return ret;
+}
+
+static char *strtosep(const char *str) {
+ int len = strlen(str);
+ char *ret = (char *)malloc(len + 3);
+ ret[0] = '^';
+ ret[len + 1] = '^';
+ ret[len + 2] = '\0';
+ for (int i = 0; i < len; i++) {
+ if ((str[i] == ':') || (str[i] == '/') || (str[i] == '?') ||
+ (str[i] == '&') || (str[i] == '=')) {
+ ret[i + 1] = '^';
+ } else {
+ ret[i + 1] = str[i];
+ }
+ }
+ return ret;
+}
+
+static bool url_matches(const char *c_url, char *c_url_sep, char *c_url_lower,
+ char *c_url_lower_sep, adblock_entry *entry) {
+ bool match = false;
+ // select comparison string based on case and separator presence (separator
+ // takes some shortcuts)
+ bool match_case = ((entry->flags & ADBLOCK_FLAG_MATCH_CASE) != 0);
+ bool match_separator = ((entry->flags & ADBLOCK_FLAG_HAS_SEPARATOR) != 0);
+ const char *match_url =
+ match_case ? (match_separator ? c_url_sep : c_url)
+ : (match_separator ? c_url_lower_sep : c_url_lower);
+
+#ifdef ADBLOCK_LOG_MORE
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "[case:%d][sep:%d][%s]",
+ match_case, match_separator, match_url);
+#endif
+ // check for all match parts at >= position of last match
+ const char *last = match_url;
+ for (int m = 0; const char *url_match = entry->matches[m]; m++) {
+ bool is_last_match = entry->matches[m + 1] == NULL;
+ const char *pos = strstr(last, url_match);
+ match = (pos != NULL);
+
+#ifdef ADBLOCK_LOG_MORE
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "[%s][found:%d][match:%d]",
+ entry->matches[m], pos == NULL ? 0 : 1, match ? 1 : 0);
+#endif
+ // check if the url starts with the first match part
+ if (match && (m == 0) && ((entry->flags & ADBLOCK_FLAG_MATCH_BEGIN) != 0) &&
+ (pos != match_url))
+ match = false;
+
+ // check if the url ends with the last match part
+ if (match && is_last_match &&
+ ((entry->flags & ADBLOCK_FLAG_MATCH_END) != 0) &&
+ (pos != &match_url[strlen(match_url) - strlen(entry->matches[m])]))
+ match = false;
+
+ // check domain match
+ if (match && (m == 0) &&
+ ((entry->flags & ADBLOCK_FLAG_MATCH_DOMAIN) != 0) &&
+ (pos != match_url) && (pos[-1] != '^') && (pos[-1] != '.') &&
+ (pos[-1] != '/'))
+ match = false;
+
+ // short circuit
+ if (!match)
+ break;
+ }
+ 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++) {
+ if (domain == origin_host) {
+ match_domain = false;
+ break;
+ }
+ }
+ }
+
+ // 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;
+}
+
+static bool url_match_party(adblock_entry *entry, const GURL &url,
+ const std::string &origin_host, bool &checked_fp,
+ bool &fp) {
+ bool wanted_fp;
+ if ((entry->flags & ADBLOCK_FLAG_THIRD_PARTY) != 0) {
+ wanted_fp = false;
+ } else if ((entry->flags & ADBLOCK_FLAG_FIRST_PARTY) != 0) {
+ wanted_fp = true;
+ } else {
+ // no-op
+ return true;
+ }
+
+ if (origin_host.empty()) {
+ // cannot match this rule, no origin host to determine first/third party
+ return false;
+ }
+
+#ifdef ADB_TESTER
+//__android_log_print(ANDROID_LOG_INFO, LOG_TAG, "matchFirst=%d matchThird=%d",
+// matchFirstParty, matchThirdParty);
+#endif
+ if (!checked_fp) {
+ // 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);
+
+ checked_fp = true;
+#ifdef ADB_TESTER
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG,
+ "is_first_party(\"%s\", \"%s\") = %s", l_host,
+ l_url_host, fp ? "true" : "false");
+#endif
+ free(l_host);
+ free(l_url_host);
+ }
+
+ return fp == wanted_fp;
+}
+
+int adblock_intercept(const GURL &url, const std::string &origin_host) {
+ // if (!url.is_valid() || !url.SchemeIsHTTPOrHTTPS()) {
+ // return 0;
+ // }
+
+ if (url.is_valid() && url.SchemeIsHTTPOrHTTPS()) {
+ const char *c_url = url.spec().c_str();
+ char *c_url_lower = strtolower(c_url);
+ char *c_url_sep = strtosep(c_url);
+ char *c_url_lower_sep = strtosep(c_url_lower);
+
+#ifdef ADBLOCK_LOG
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "[%s with host '%s'] [%s]",
+ c_url, url.host().c_str(), origin_host.c_str());
+#endif
+
+ bool checked_fp = false, fp = false;
+
+ bool intercept = false;
+ for (int i = 0; i < ADBLOCK_ENTRY_COUNT; i++) {
+ adblock_entry *entry = &ADBLOCK_ENTRIES[i];
+
+ // no use checking rules when we're intercepting, or exceptions when not
+ 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))
+ continue;
+
+ // 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))
+ continue;
+
+#ifdef ADBLOCK_LOG
+ if (!intercept) {
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG,
+ "--> intercept (#%d: \"%s\") (%x)", i,
+ entry->matches[0], entry->flags);
+ } else {
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "--> pass (%d) (#%d)", i,
+ entry->flags);
+ }
+#endif
+ intercept = !intercept;
+ } // for each entry
+
+ free(c_url_sep);
+ free(c_url_lower);
+ free(c_url_lower_sep);
+
+ if (intercept) {
+#ifdef ADBLOCK_LOG
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "blocked");
+#endif
+ return 1;
+ }
+#ifdef ADBLOCK_LOG
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "pass");
+#endif
+ }
+ return 0;
+}
+
+} // namespace net
diff --git a/net/url_request/adblock_intercept.h b/net/url_request/adblock_intercept.h
new file mode 100644
--- /dev/null
+++ b/net/url_request/adblock_intercept.h
@@ -0,0 +1,16 @@
+#ifndef NET_URL_REQUEST_ADBLOCK_INTERCEPT_H_
+#define NET_URL_REQUEST_ADBLOCK_INTERCEPT_H_
+
+#include "url/gurl.h"
+
+namespace net {
+
+#ifdef ADB_TESTER
+int adblock_rules_count();
+#endif
+
+int adblock_intercept(const GURL &url, const std::string &origin_host);
+
+} // namespace net
+
+#endif // NET_URL_REQUEST_ADBLOCK_INTERCEPT_H_
diff --git a/net/url_request/nochromo_intercept.cc b/net/url_request/nochromo_intercept.cc
deleted file mode 100644
--- a/net/url_request/nochromo_intercept.cc
+++ /dev/null
@@ -1,116 +0,0 @@
-#include "url/gurl.h"
-#include "net/url_request/nochromo_entries.h"
-
-#include <android/log.h>
-
-namespace net {
-
-#define NOCHROMO_LOG 0
-#define NOCHROMO_LOG_MORE 0
-
-static char* strtolower(const char* str) {
- int len = strlen(str);
- char* ret = (char*)malloc(len + 1);
- ret[len] = '\0';
- for (int i = 0; i < len; i++) {
- if ((65 <= str[i]) && (str[i] <= 90)) {
- ret[i] = str[i] + 32;
- } else {
- ret[i] = str[i];
- }
- }
- return ret;
-}
-
-static char* strtosep(const char* str) {
- int len = strlen(str);
- char* ret = (char*)malloc(len + 3);
- ret[0] = '^';
- ret[len + 1] = '^';
- ret[len + 2] = '\0';
- for (int i = 0; i < len; i++) {
- if ((str[i] == ':') || (str[i] == '/') || (str[i] == '?') || (str[i] == '&') || (str[i] == '=')) {
- ret[i + 1] = '^';
- } else {
- ret[i + 1] = str[i];
- }
- }
- return ret;
-}
-
-int nochromo_intercept(const GURL& url) {
- if (url.is_valid() && url.SchemeIsHTTPOrHTTPS()) {
- const char* c_url = url.spec().c_str();
- char* c_url_lower = strtolower(c_url);
- char* c_url_sep = strtosep(c_url);
- char* c_url_lower_sep = strtosep(c_url_lower);
-
- if (NOCHROMO_LOG) __android_log_print(ANDROID_LOG_INFO, "NoChromo", "[%s]", c_url);
-
- bool intercept = false;
- for (int i = 0; i < NOCHROMO_ENTRY_COUNT; i++) {
- nochromo_entry* entry = &NOCHROMO_ENTRIES[i];
-
- // no use checking rules when we're intercepting, or exceptions when not
- bool check =
- (!intercept && ((entry->flags & NOCHROMO_FLAG_EXCEPTION) == 0)) ||
- (intercept && ((entry->flags & NOCHROMO_FLAG_EXCEPTION) != 0));
-
- if (check) {
- bool match = false;
-
- // select comparison string based on case and separator presence (separator takes some shortcuts)
- bool match_case = ((entry->flags & NOCHROMO_FLAG_MATCH_CASE) != 0);
- bool match_separator = ((entry->flags & NOCHROMO_FLAG_HAS_SEPARATOR) != 0);
- const char* match_url = match_case ? (match_separator ? c_url_sep : c_url) : (match_separator ? c_url_lower_sep : c_url_lower);
-
- if (NOCHROMO_LOG || NOCHROMO_LOG_MORE) __android_log_print(ANDROID_LOG_INFO, "NoChromo", "[case:%d][sep:%d][%s]", match_case, match_separator, match_url);
-
- // check for all match parts at >= position of last match
- const char* last = match_url;
- for (int m = 0; m < entry->matchcount; m++) {
- const char* pos = strstr(last, entry->matches[m]);
- match = (pos != NULL);
-
- if (NOCHROMO_LOG || NOCHROMO_LOG_MORE) __android_log_print(ANDROID_LOG_INFO, "NoChromo", "[%s][found:%d][match:%d]", entry->matches[m], pos == NULL ? 0 : 1, match ? 1 : 0);
-
- // check if the url starts with the first match part
- if (match && (m == 0) && ((entry->flags & NOCHROMO_FLAG_MATCH_BEGIN) != 0) && (pos != match_url)) match = false;
-
- // check if the url ends with the last match part
- if (match && (m == entry->matchcount - 1) && ((entry->flags & NOCHROMO_FLAG_MATCH_END) != 0) && (pos != &match_url[strlen(match_url) - strlen(entry->matches[m])])) match = false;
-
- // check domain match
- if (match && (m == 0) && ((entry->flags & NOCHROMO_FLAG_MATCH_DOMAIN) != 0) && (pos != match_url) && (pos[-1] != '^') && (pos[-1] != '.') && (pos[-1] != '/')) match = false;
-
- // short circuit
- if (!match) break;
- }
-
- if (match) {
- if (NOCHROMO_LOG) {
- if (!intercept) {
- __android_log_print(ANDROID_LOG_INFO, "NoChromo", "--> intercept (%d) (%d)", i, entry->flags);
- } else {
- __android_log_print(ANDROID_LOG_INFO, "NoChromo", "--> pass (%d) (%d)", i, entry->flags);
- }
- }
- intercept = !intercept;
- }
- }
- }
-
- free(c_url_sep);
- free(c_url_lower);
- free(c_url_lower_sep);
-
- if (intercept) {
- if (NOCHROMO_LOG) __android_log_print(ANDROID_LOG_INFO, "NoChromo", "intercepted!");
- return 1;
- }
- if (NOCHROMO_LOG) __android_log_print(ANDROID_LOG_INFO, "NoChromo", "pass!");
- }
- return 0;
-}
-
-} // namespace net
\ No newline at end of file
diff --git a/net/url_request/nochromo_intercept.h b/net/url_request/nochromo_intercept.h
deleted file mode 100644
--- a/net/url_request/nochromo_intercept.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef NET_URL_REQUEST_NOCHROMO_INTERCEPT_H_
-#define NET_URL_REQUEST_NOCHROMO_INTERCEPT_H_
-
-#include "url/gurl.h"
-
-namespace net {
-
-GURL nochromo_intercepted = GURL("http://127.0.0.1/");
-int nochromo_intercept(const GURL& url);
-
-} // namespace net
-
-#endif // NET_URL_REQUEST_NOCHROMO_INTERCEPT_H_
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
--- a/net/url_request/url_request.cc
+++ b/net/url_request/url_request.cc
@@ -43,7 +43,9 @@
#include "url/gurl.h"
#include "url/origin.h"
-#include "net/url_request/nochromo_intercept.h"
+#if defined(OS_ANDROID)
+#include "net/url_request/adblock_intercept.h"
+#endif
#if BUILDFLAG(ENABLE_REPORTING)
#include "net/network_error_logging/network_error_logging_service.h"
@@ -558,7 +560,9 @@ URLRequest::URLRequest(const GURL& url,
: context->network_delegate()),
net_log_(NetLogWithSource::Make(context->net_log(),
NetLogSourceType::URL_REQUEST)),
+#if !defined(OS_ANDROID)
url_chain_(1, url),
+#endif
method_("GET"),
referrer_policy_(CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE),
first_party_url_policy_(NEVER_CHANGE_FIRST_PARTY_URL),
@@ -583,7 +587,18 @@ URLRequest::URLRequest(const GURL& url,
// Sanity check out environment.
DCHECK(base::ThreadTaskRunnerHandle::IsSet());
- if (nochromo_intercept(url)) url_chain_.push_back(nochromo_intercepted);
+#if defined(OS_ANDROID)
+ std::string initiatorHost;
+ if (initiator_.has_value()) {
+ initiatorHost = initiator_.value().host();
+ }
+
+ if (adblock_intercept(url, initiatorHost)) {
+ url_chain_ = { url, GURL("http://127.0.0.1") };
+ } else {
+ url_chain_ = { url };
+ }
+#endif
context->url_requests()->insert(this);
net_log_.BeginEvent(
--
2.7.4
@@ -3,9 +3,22 @@ Date: Thu, 22 Mar 2018 22:11:57 +0100
Subject: Battery API: return nothing
---
services/device/battery/battery_status_service.cc | 2 +-
.../Source/modules/battery/BatteryManager.cpp | 25 ++++------------------
1 file changed, 4 insertions(+), 21 deletions(-)
2 files changed, 5 insertions(+), 22 deletions(-)
diff --git a/services/device/battery/battery_status_service.cc b/services/device/battery/battery_status_service.cc
--- a/services/device/battery/battery_status_service.cc
+++ b/services/device/battery/battery_status_service.cc
@@ -41,7 +41,7 @@ BatteryStatusService::AddCallback(const BatteryUpdateCallback& callback) {
if (!battery_fetcher_)
battery_fetcher_ = BatteryStatusManager::Create(update_callback_);
-#if 0
+#if !defined(OS_ANDROID)
if (callback_list_.empty()) {
bool success = battery_fetcher_->StartListeningBatteryChange();
// On failure pass the default values back.
diff --git a/third_party/WebKit/Source/modules/battery/BatteryManager.cpp b/third_party/WebKit/Source/modules/battery/BatteryManager.cpp
--- a/third_party/WebKit/Source/modules/battery/BatteryManager.cpp
+++ b/third_party/WebKit/Source/modules/battery/BatteryManager.cpp
@@ -9,7 +9,7 @@ Subject: Disable plugins enumeration
diff --git a/third_party/WebKit/Source/core/frame/LocalFrame.cpp b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
--- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp
+++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
@@ -1086,10 +1086,8 @@ FrameResourceCoordinator* LocalFrame::GetFrameResourceCoordinator() {
@@ -1134,10 +1134,8 @@ FrameResourceCoordinator* LocalFrame::GetFrameResourceCoordinator() {
}
PluginData* LocalFrame::GetPluginData() const {
@@ -2,10 +2,12 @@ From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sun, 25 Mar 2018 21:49:37 +0200
Subject: AudioBuffer, AnalyserNode: fingerprinting mitigations via IDL
Return fixed base latency
---
third_party/WebKit/Source/modules/webaudio/AnalyserNode.idl | 8 ++++----
third_party/WebKit/Source/modules/webaudio/AudioBuffer.idl | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)
third_party/WebKit/Source/modules/webaudio/AudioContext.cpp | 2 +-
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/third_party/WebKit/Source/modules/webaudio/AnalyserNode.idl b/third_party/WebKit/Source/modules/webaudio/AnalyserNode.idl
--- a/third_party/WebKit/Source/modules/webaudio/AnalyserNode.idl
@@ -38,6 +40,18 @@ diff --git a/third_party/WebKit/Source/modules/webaudio/AudioBuffer.idl b/third_
+ //[RaisesException] void copyFromChannel(Float32Array destination, long channelNumber, optional unsigned long startInChannel = 0);
[RaisesException] void copyToChannel(Float32Array source, long channelNumber, optional unsigned long startInChannel = 0);
};
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioContext.cpp b/third_party/WebKit/Source/modules/webaudio/AudioContext.cpp
--- a/third_party/WebKit/Source/modules/webaudio/AudioContext.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/AudioContext.cpp
@@ -261,7 +261,7 @@ void AudioContext::StopRendering() {
}
double AudioContext::baseLatency() const {
- return FramesPerBuffer() / static_cast<double>(sampleRate());
+ return 0.04;
}
} // namespace blink
--
2.7.4
@@ -0,0 +1,181 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Wed, 18 Oct 2017 21:26:53 +0200
Subject: Add menu option to toggle global Javascript preference
---
chrome/android/java/res/menu/custom_tabs_menu.xml | 13 ++++++++
chrome/android/java/res/menu/main_menu.xml | 13 ++++++++
.../chromium/chrome/browser/ChromeActivity.java | 8 +++++
.../chrome/browser/ChromeTabbedActivity.java | 8 +++++
.../browser/appmenu/AppMenuPropertiesDelegate.java | 35 ++++++++++++++++++++++
.../CustomTabAppMenuPropertiesDelegate.java | 1 +
.../java/strings/android_chrome_strings.grd | 11 +++++++
7 files changed, 89 insertions(+)
diff --git a/chrome/android/java/res/menu/custom_tabs_menu.xml b/chrome/android/java/res/menu/custom_tabs_menu.xml
--- a/chrome/android/java/res/menu/custom_tabs_menu.xml
+++ b/chrome/android/java/res/menu/custom_tabs_menu.xml
@@ -49,6 +49,19 @@
<item android:id="@+id/open_webapk_id"
android:title="@string/menu_open_webapk"
android:orderInCategory="2" />
+
+ <item android:id="@+id/enable_javascript_row_menu_id"
+ android:title="@null"
+ android:orderInCategory="2">
+ <menu>
+ <item android:id="@+id/enable_javascript_id"
+ android:title="@string/menu_enable_javascript" />
+ <item android:id="@+id/enable_javascript_check_id"
+ android:title="@null"
+ android:checkable="true" />
+ </menu>
+ </item>
+
<item android:id="@+id/request_desktop_site_row_menu_id"
android:title="@null"
android:orderInCategory="2">
diff --git a/chrome/android/java/res/menu/main_menu.xml b/chrome/android/java/res/menu/main_menu.xml
--- a/chrome/android/java/res/menu/main_menu.xml
+++ b/chrome/android/java/res/menu/main_menu.xml
@@ -59,6 +59,19 @@
android:title="@string/menu_add_to_homescreen" />
<item android:id="@+id/open_webapk_id"
android:title="@string/menu_open_webapk" />
+
+ <item android:id="@+id/enable_javascript_row_menu_id"
+ android:title="@null"
+ android:orderInCategory="2">
+ <menu>
+ <item android:id="@+id/enable_javascript_id"
+ android:title="@string/menu_enable_javascript" />
+ <item android:id="@+id/enable_javascript_check_id"
+ android:title="@null"
+ android:checkable="true" />
+ </menu>
+ </item>
+
<item android:id="@+id/request_desktop_site_row_menu_id"
android:title="@null">
<menu>
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
@@ -2006,6 +2006,14 @@ public abstract class ChromeActivity extends AsyncInitializationActivity
final boolean usingDesktopUserAgent = currentTab.getUseDesktopUserAgent();
currentTab.setUseDesktopUserAgent(!usingDesktopUserAgent, reloadOnChange);
RecordUserAction.record("MobileMenuRequestDesktopSite");
+ } else if (id == R.id.enable_javascript_id || id == R.id.enable_javascript_check_id) {
+ final boolean reloadOnChange = !currentTab.isNativePage();
+ final boolean jsEnabled = PrefServiceBridge.getInstance().javaScriptEnabled();
+ PrefServiceBridge.getInstance().setJavaScriptEnabled(!jsEnabled);
+ if (reloadOnChange) {
+ currentTab.reload();
+ }
+ RecordUserAction.record("MobileMenuRequestEnableJavascript");
} else if (id == R.id.reader_mode_prefs_id) {
DomDistillerUIUtils.openSettings(currentTab.getWebContents());
} else {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
@@ -1796,6 +1796,14 @@ public class ChromeTabbedActivity
NewTabPageUma.recordAction(NewTabPageUma.ACTION_OPENED_DOWNLOADS_MANAGER);
}
RecordUserAction.record("MobileMenuDownloadManager");
+ } else if (id == R.id.enable_javascript_id || id == R.id.enable_javascript_check_id) {
+ final boolean reloadOnChange = !currentTab.isNativePage();
+ final boolean jsEnabled = PrefServiceBridge.getInstance().javaScriptEnabled();
+ PrefServiceBridge.getInstance().setJavaScriptEnabled(!jsEnabled);
+ if (reloadOnChange) {
+ currentTab.reload();
+ }
+ RecordUserAction.record("MobileMenuRequestEnableJavascript");
} else if (id == R.id.open_recently_closed_tab) {
TabModel currentModel = mTabModelSelectorImpl.getCurrentModel();
if (!currentModel.isIncognito()) currentModel.openMostRecentlyClosedTab();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java
@@ -213,6 +213,8 @@ public class AppMenuPropertiesDelegate {
updateRequestDesktopSiteMenuItem(menu, currentTab, true /* can show */);
+ updateEnableJavascriptMenuItem(menu, currentTab);
+
// Only display reader mode settings menu option if the current page is in reader mode.
menu.findItem(R.id.reader_mode_prefs_id)
.setVisible(DomDistillerUrlUtils.isDistilledPage(currentTab.getUrl()));
@@ -468,4 +470,37 @@ public class AppMenuPropertiesDelegate {
return chromeHomeMenuItemFlagEnabled && !sHideChromeHomeMenuItems;
}
+
+ /**
+ * Updates the enable JavaScript item's state.
+ *
+ * @param menu {@link Menu} for enable javascript
+ * @param currentTab Current tab being displayed.
+ */
+ protected void updateEnableJavascriptMenuItem(
+ Menu menu, Tab currentTab) {
+ MenuItem enableMenuRow = menu.findItem(R.id.enable_javascript_row_menu_id);
+ MenuItem enableMenuLabel = menu.findItem(R.id.enable_javascript_id);
+ MenuItem enableMenuCheck = menu.findItem(R.id.enable_javascript_check_id);
+
+ // Hide enable javascript on all chrome:// pages and the NTP.
+ String url = currentTab.getUrl();
+ boolean isChromeScheme = url.startsWith(UrlConstants.CHROME_URL_PREFIX)
+ || url.startsWith(UrlConstants.CHROME_NATIVE_URL_PREFIX);
+
+ boolean itemVisible = !isChromeScheme && !currentTab.isNativePage();
+ enableMenuRow.setVisible(itemVisible);
+ if (!itemVisible) return;
+
+ boolean jsEnabled = PrefServiceBridge.getInstance().javaScriptEnabled();
+
+ // Mark the checkbox if Javascript is activated on this tab.
+ enableMenuCheck.setChecked(jsEnabled);
+
+ // This title doesn't seem to be displayed by Android, but it is used to set up
+ // accessibility text in {@link AppMenuAdapter#setupMenuButton}.
+ enableMenuLabel.setTitleCondensed(jsEnabled
+ ? mActivity.getString(R.string.menu_enable_javascript_on)
+ : mActivity.getString(R.string.menu_enable_javascript_off));
+ }
}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java
@@ -164,6 +164,7 @@ public class CustomTabAppMenuPropertiesDelegate extends AppMenuPropertiesDelegat
}
updateRequestDesktopSiteMenuItem(menu, currentTab, requestDesktopSiteVisible);
+ updateEnableJavascriptMenuItem(menu, currentTab);
prepareAddToHomescreenMenuItem(menu, currentTab, addToHomeScreenVisible);
}
}
diff --git a/chrome/android/java/strings/android_chrome_strings.grd b/chrome/android/java/strings/android_chrome_strings.grd
--- a/chrome/android/java/strings/android_chrome_strings.grd
+++ b/chrome/android/java/strings/android_chrome_strings.grd
@@ -2491,6 +2491,17 @@ To obtain new licenses, connect to the internet and play your downloaded content
<message name="IDS_MENU_FIND_IN_PAGE" desc="Menu item allowing users to find text within the current page. [CHAR-LIMIT=27]">
Find in page
</message>
+
+ <message name="IDS_MENU_ENABLE_JAVASCRIPT" desc="Menu item in Chrome's overflow/options menu. If this menu item is unselected, Bromite will disable JavaScript support for the page. [CHAR-LIMIT=27]">
+ Enable JavaScript
+ </message>
+ <message name="IDS_MENU_ENABLE_JAVASCRIPT_ON" desc="Accessibility description for when Enable JavaScript is selected.">
+ Turn off JavaScript
+ </message>
+ <message name="IDS_MENU_ENABLE_JAVASCRIPT_OFF" desc="Accessibility description for when Enable JavaScript is unselected.">
+ Turn on JavaScript
+ </message>
+
<message name="IDS_MENU_REQUEST_DESKTOP_SITE" desc="Menu item in Chrome's overflow/options menu. By default, when a user navigates to a web page, Chrome shows the mobile site, that is, the version of the site designed for mobile phones. If this menu item is selected, however, Chrome will try to load the 'desktop' site instead, i.e. the site designed for desktop computers or laptop computers, which have larger screens. [CHAR-LIMIT=24]">
Desktop site
</message>
--
2.7.4
@@ -0,0 +1,45 @@
From: SergeyZhukovsky <serg.zhukovsky@gmail.com>
Date: Tue, 15 Aug 2017 15:33:16 -0400
Subject: Remove google account access permission on reboot
---
chrome/android/BUILD.gn | 3 +--
chrome/android/java/AndroidManifest.xml | 4 ++--
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
--- a/chrome/android/BUILD.gn
+++ b/chrome/android/BUILD.gn
@@ -726,8 +726,7 @@ android_assets("chrome_public_locale_pak_assets") {
jinja_template_resources("chrome_public_apk_template_resources") {
resources = [
"java/res_template/xml/launchershortcuts.xml",
- "java/res_template/xml/searchable.xml",
- "java/res_template/xml/syncadapter.xml",
+ "java/res_template/xml/searchable.xml"
]
res_dir = "java/res_template"
variables = chrome_public_jinja_variables
diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml
--- a/chrome/android/java/AndroidManifest.xml
+++ b/chrome/android/java/AndroidManifest.xml
@@ -822,14 +822,14 @@ by a child template that "extends" this file.
</provider>
<!-- Sync adapter for browser invalidation. -->
- <service android:name="org.chromium.chrome.browser.invalidation.ChromeBrowserSyncAdapterService"
+ <!--<service android:name="org.chromium.chrome.browser.invalidation.ChromeBrowserSyncAdapterService"
android:exported="false">
<intent-filter>
<action android:name="android.content.SyncAdapter" />
</intent-filter>
<meta-data android:name="android.content.SyncAdapter"
android:resource="@xml/syncadapter" />
- </service>
+ </service>-->
<!-- Broadcast receiver that will be notified of account changes -->
<receiver android:name="org.chromium.chrome.browser.services.AccountsChangedReceiver">
--
2.7.4
@@ -0,0 +1,36 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Mon, 2 Apr 2018 11:36:02 +0200
Subject: Punt the Widevine version string
Originally from http://bazaar.launchpad.net/~saiarcot895/chromium-browser/chromium-browser.wily.beta/view/head:/debian/patches/fix_building_widevinecdm_with_chromium.patch
---
chrome/common/chrome_content_client.cc | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/chrome/common/chrome_content_client.cc b/chrome/common/chrome_content_client.cc
--- a/chrome/common/chrome_content_client.cc
+++ b/chrome/common/chrome_content_client.cc
@@ -238,10 +238,7 @@ void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) {
info.is_out_of_process = true;
info.path = adapter_path;
info.name = kWidevineCdmDisplayName;
- info.description =
- base::StringPrintf("%s (version: " WIDEVINE_CDM_VERSION_STRING ")",
- kWidevineCdmDescription);
- info.version = WIDEVINE_CDM_VERSION_STRING;
+ info.description = kWidevineCdmDescription;
info.permissions = kWidevineCdmPluginPermissions;
content::WebPluginMimeType mime_type(kWidevineCdmPluginMimeType,
@@ -566,7 +563,7 @@ void ChromeContentClient::AddContentDecryptionModules(
// CdmInfo needs |path| to be the actual Widevine library,
// not the adapter, so adjust as necessary. It will be in the
// same directory as the installed adapter.
- const base::Version version(WIDEVINE_CDM_VERSION_STRING);
+ const base::Version version("1.0.123.456");
DCHECK(version.IsValid());
cdms->push_back(content::CdmInfo(
--
2.7.4
@@ -0,0 +1,23 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Wed, 25 Apr 2018 10:23:51 +0200
Subject: Disable metrics on all I/O threads
---
chrome/browser/profiles/profile_io_data.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc
--- a/chrome/browser/profiles/profile_io_data.cc
+++ b/chrome/browser/profiles/profile_io_data.cc
@@ -971,7 +971,7 @@ void ProfileIOData::InitializeMetricsEnabledStateOnUIThread() {
bool ProfileIOData::GetMetricsEnabledStateOnIOThread() const {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
- return enable_metrics_.GetValue();
+ return false;
}
chrome_browser_net::Predictor* ProfileIOData::GetPredictor() {
--
2.7.4
@@ -0,0 +1,22 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sat, 28 Apr 2018 08:30:26 +0200
Subject: Enable DNS-over-HTTPS by default
---
components/network_session_configurator/common/network_features.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/components/network_session_configurator/common/network_features.cc b/components/network_session_configurator/common/network_features.cc
--- a/components/network_session_configurator/common/network_features.cc
+++ b/components/network_session_configurator/common/network_features.cc
@@ -10,6 +10,6 @@ const base::Feature kTokenBinding{"token-binding",
base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kDnsOverHttps{"dns-over-https",
- base::FEATURE_DISABLED_BY_DEFAULT};
+ base::FEATURE_ENABLED_BY_DEFAULT};
} // namespace features
--
2.7.4
@@ -0,0 +1,130 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Fri, 30 Mar 2018 10:09:03 +0200
Subject: Add fingerprinting mitigation for getClientRects,
getBoundingClientRect
Scale the result of Range::getClientRects and Element::getBoundingClientRect
by a random +/-3% of the original value for each float in the Rect/Quad.
The random value is generated once for each Document and re-used for all the
attached elements.
The rationale is that such value, albeit constant within the rendered Document,
is within the same order of magniture of the floating point precision being
used for fingerprinting and sufficient to poison the well.
See also: http://www.gsd.inesc-id.pt/~mpc/pubs/fingerprinting-trustcom2016.pdf
---
third_party/WebKit/Source/core/dom/Document.cpp | 14 ++++++++++++++
third_party/WebKit/Source/core/dom/Document.h | 5 +++++
third_party/WebKit/Source/core/dom/Element.cpp | 7 +++++++
third_party/WebKit/Source/core/dom/Range.cpp | 8 +++++++-
4 files changed, 33 insertions(+), 1 deletion(-)
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -272,6 +272,8 @@
#include "services/service_manager/public/cpp/interface_provider.h"
#include "third_party/WebKit/public/mojom/page/page_visibility_state.mojom-blink.h"
+#include "base/rand_util.h"
+
#ifndef NDEBUG
using WeakDocumentSet =
blink::PersistentHeapHashSet<blink::WeakMember<blink::Document>>;
@@ -731,6 +733,10 @@ Document::Document(const DocumentInit& initializer,
#ifndef NDEBUG
liveDocumentSet().insert(this);
#endif
+
+ // add +/- 3% noise against fingerprinting
+ shuffleFactorX_ = 1 + (base::RandDouble() - 0.5) * 0.03;
+ shuffleFactorY_ = 1 + (base::RandDouble() - 0.5) * 0.03;
}
Document::~Document() {
@@ -757,6 +763,14 @@ Range* Document::CreateRangeAdjustedToTreeScope(const TreeScope& tree_scope,
Position::BeforeNode(*shadow_host));
}
+double Document::GetShuffleFactorX() {
+ return shuffleFactorX_;
+}
+
+double Document::GetShuffleFactorY() {
+ return shuffleFactorY_;
+}
+
SelectorQueryCache& Document::GetSelectorQueryCache() {
if (!selector_query_cache_)
selector_query_cache_ = std::make_unique<SelectorQueryCache>();
diff --git a/third_party/WebKit/Source/core/dom/Document.h b/third_party/WebKit/Source/core/dom/Document.h
--- a/third_party/WebKit/Source/core/dom/Document.h
+++ b/third_party/WebKit/Source/core/dom/Document.h
@@ -406,6 +406,9 @@ class CORE_EXPORT Document : public ContainerNode,
String origin() const;
+ double GetShuffleFactorX();
+ double GetShuffleFactorY();
+
String visibilityState() const;
mojom::PageVisibilityState GetPageVisibilityState() const;
bool hidden() const;
@@ -1663,6 +1666,8 @@ class CORE_EXPORT Document : public ContainerNode,
double start_time_;
+ double shuffleFactorX_, shuffleFactorY_;
+
TraceWrapperMember<ScriptRunner> script_runner_;
HeapVector<Member<ScriptElementBase>> current_script_stack_;
diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -1327,6 +1327,11 @@ DOMRectList* Element::getClientRects() {
DCHECK(element_layout_object);
GetDocument().AdjustFloatQuadsForScrollAndAbsoluteZoom(
quads, *element_layout_object);
+
+ for (FloatQuad& quad : quads) {
+ quad.Scale(GetDocument().GetShuffleFactorX(), GetDocument().GetShuffleFactorY());
+ }
+
return DOMRectList::Create(quads);
}
@@ -1344,6 +1349,8 @@ DOMRect* Element::getBoundingClientRect() {
DCHECK(element_layout_object);
GetDocument().AdjustFloatRectForScrollAndAbsoluteZoom(result,
*element_layout_object);
+ result.Scale(GetDocument().GetShuffleFactorX(), GetDocument().GetShuffleFactorY());
+
return DOMRect::FromFloatRect(result);
}
diff --git a/third_party/WebKit/Source/core/dom/Range.cpp b/third_party/WebKit/Source/core/dom/Range.cpp
--- a/third_party/WebKit/Source/core/dom/Range.cpp
+++ b/third_party/WebKit/Source/core/dom/Range.cpp
@@ -1589,11 +1589,17 @@ DOMRectList* Range::getClientRects() const {
Vector<FloatQuad> quads;
GetBorderAndTextQuads(quads);
+ for (FloatQuad& quad : quads) {
+ quad.Scale(owner_document_->GetShuffleFactorX(), owner_document_->GetShuffleFactorY());
+ }
+
return DOMRectList::Create(quads);
}
DOMRect* Range::getBoundingClientRect() const {
- return DOMRect::FromFloatRect(BoundingRect());
+ auto rect = BoundingRect();
+ rect.Scale(owner_document_->GetShuffleFactorX(), owner_document_->GetShuffleFactorY());
+ return DOMRect::FromFloatRect(rect);
}
// TODO(editing-dev): We should make
--
2.7.4
@@ -0,0 +1,28 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Wed, 2 May 2018 01:04:07 +0200
Subject: Disable custom tab activities permanently
---
.../src/org/chromium/chrome/browser/LaunchIntentDispatcher.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java b/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java
@@ -149,9 +149,10 @@ public class LaunchIntentDispatcher implements IntentHandler.IntentHandlerDelega
recordIntentMetrics();
mIsVrIntent = VrIntentUtils.isVrIntent(mIntent);
- boolean isCustomTabIntent = (!mIsVrIntent && isCustomTabIntent(mIntent))
- || (mIsVrIntent && VrIntentUtils.isCustomTabVrIntent(mIntent));
- mIsCustomTabIntent = isCustomTabIntent;
+ //boolean isCustomTabIntent = (!mIsVrIntent && isCustomTabIntent(mIntent))
+ // || (mIsVrIntent && VrIntentUtils.isCustomTabVrIntent(mIntent));
+ //mIsCustomTabIntent = isCustomTabIntent;
+ mIsCustomTabIntent = false;
}
/**
--
2.7.4
@@ -12,7 +12,7 @@ Disable toDataURL, toBlob, getImageData and webGL renderering info
diff --git a/third_party/WebKit/Source/core/html/canvas/HTMLCanvasElement.idl b/third_party/WebKit/Source/core/html/canvas/HTMLCanvasElement.idl
--- a/third_party/WebKit/Source/core/html/canvas/HTMLCanvasElement.idl
+++ b/third_party/WebKit/Source/core/html/canvas/HTMLCanvasElement.idl
@@ -36,9 +36,9 @@ interface HTMLCanvasElement : HTMLElement
@@ -37,9 +37,9 @@ interface HTMLCanvasElement : HTMLElement
// Note: The arguments argument is variadic in the spec, but not here as
// only one extra argument is actually used.
// FIXME: type should not have a default value.