Compare commits

...
Author SHA1 Message Date
csagan5 fb225cf638 Release 71.0.3578.115 2019-01-01 13:30:36 +01:00
csagan5 9c88a30ac3 Add link to wiki for SystemWebView instructions 2018-12-29 18:31:26 +01:00
csagan5 0c9047e26d Release 71.0.3578.110 2018-12-28 00:00:44 +01:00
csagan5 0d37a542ff Correct safe_browsing flag 2018-12-21 11:02:47 +01:00
csagan5 34b616ba9f Release 71.0.3578.104 2018-12-21 11:01:16 +01:00
csagan5 2e6d2a5c75 Mention GN_ARGS in README 2018-12-21 10:31:38 +01:00
csagan5 f963a09239 Release 71.0.3578.101 2018-12-18 23:53:07 +01:00
csagan5 fcbca7eb8c Release 71.0.3578.98 2018-12-16 07:30:03 +01:00
csagan5 65c50e3ec9 Release 71.0.3578.88 2018-12-13 07:22:42 +01:00
csagan5 6cf627f9d4 Release 71.0.3578.85 2018-12-06 11:31:38 +01:00
109 changed files with 3926 additions and 512 deletions
+22
View File
@@ -1,3 +1,25 @@
# 71.0.3578.115
* add AdGuard DNS-over-HTTPS option
* use green icon for SystemWebView
# 71.0.3578.110
# 71.0.3578.104
* fix AMP links sanitisation; have it working for news as well (fixes https://github.com/bromite/bromite/issues/202)
* revert upstream patch responsible for the broken save dialog prompt (upstream: https://bugs.chromium.org/p/chromium/issues/detail?id=916606)
# 71.0.3578.101
# 71.0.3578.98
* do not ask permissions for camera when importing bookmarks (fixes https://github.com/bromite/bromite/issues/200)
# 71.0.3578.88
* add proxy configuration page (see https://github.com/bromite/bromite/wiki/ProxyConfiguration)
* use more recent versions in User-Agent (fixes https://github.com/bromite/bromite/issues/156)
# 71.0.3578.85
* fix blurry adaptive icon (fixes https://github.com/bromite/bromite/issues/197)
# 71.0.3578.76
# 71.0.3578.72
+7 -1
View File
@@ -46,6 +46,8 @@ Projects which follow a strict approach on this are [Iridium](https://iridiumbro
## 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.
See also [the wiki page](https://github.com/bromite/bromite/wiki/Installing-SystemWebView) for community-contributed installation instructions.
## How to enable DNS-over-HTTPS?
See [this wiki page](https://github.com/bromite/bromite/wiki/Enabling-DNS-over-HTTPS).
@@ -76,6 +78,7 @@ Yes, since version 69. While the desktop version of Chromium has an option to di
* 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 and Quad9 servers
* [proxy configuration page](https://github.com/bromite/bromite/wiki/ProxyConfiguration) with PAC and custom proxy lists support
* [StartPage](https://startpage.com/), [DuckDuckGo](https://duckduckgo.com/) and [Qwant](https://www.qwant.com/) search engines
* chrome flags to disable custom intents and clear session on exit
* always-incognito mode
@@ -90,7 +93,7 @@ Yes, since version 69. While the desktop version of Chromium has an option to di
* all codecs included (proprietary, open H.264 etc.)
* built with official speed optimizations
You can inspect all functionality/privacy changes by reading the patches: https://github.com/bromite/bromite/tree/master/patches
You can inspect all functionality/privacy changes by reading the patches: https://github.com/bromite/bromite/tree/master/build/patches
# Releases
@@ -133,6 +136,9 @@ The [Bromite main repository](https://github.com/bromite/bromite) contains tags
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.
The GN args used to build Bromite are available here: [GN_ARGS](./GN_ARGS).
The patches are to be applied second the order specified in the `patches_list.txt` file (you can use `git am`); the big file `adblock_entries.h` (containing all the AdBlock filters) needs to be copied under `src/net/url_request/`
# Credits
* [Chromium project](https://www.chromium.org/Home) and developers
+30
View File
@@ -0,0 +1,30 @@
android_channel="stable"
blink_symbol_level=1
dcheck_always_on=false
debuggable_apks=false
enable_ac3_eac3_audio_demuxing=true enable_hevc_demuxing=true enable_iterator_debugging=false
enable_av1_decoder=true
enable_hangout_services_extension=false
enable_mdns=false
enable_mse_mpeg2ts_stream_parser=true ffmpeg_branding="Chrome" proprietary_codecs=true
enable_nacl=false
enable_nacl_nonsfi=false
enable_remoting=false
enable_reporting=false
enable_resource_whitelist_generation=false
enable_vr=false
fieldtrial_testing_like_official_build=true
is_component_build=false
is_debug=false
is_official_build=true
jumbo_file_merge_limit=60
safe_browsing_mode=0
strip_absolute_paths_from_debug_symbols=true
strip_debug_info=false
symbol_level=1
target_os="android"
use_debug_fission=true
use_errorprone_java_compiler=false
use_official_google_api_keys=false
use_openh264=true chrome_pgo_phase=0 full_wpo_on_official=true
use_sysroot=false
File diff suppressed because one or more lines are too long
@@ -5,25 +5,26 @@ Subject: Add a flag for DNS-over-HTTPS
Allow selection between Google and Cloudflare endpoints.
Serve DoH requests with maximum priority, remove traffic annotation.
Reduce HTTP headers in DoH requests to bare minimum.
Add AdGuard (default) endpoint
See also: https://tools.ietf.org/id/draft-ietf-doh-dns-over-https-12.txt
See also: https://tools.ietf.org/id/draft-ietf-doh-dns-over-https-14.txt
---
chrome/browser/about_flags.cc | 13 ++++++++++
chrome/browser/about_flags.cc | 14 +++++++++++
chrome/browser/flag_descriptions.cc | 3 +++
chrome/browser/flag_descriptions.h | 3 +++
.../browser/net/system_network_context_manager.cc | 16 ++++++-------
.../common/network_features.cc | 6 +++--
.../common/network_features.h | 4 +++-
.../common/network_features.cc | 7 ++++--
.../common/network_features.h | 5 +++-
.../common/network_switch_list.h | 4 ++++
net/base/load_flags_list.h | 6 +++++
net/dns/dns_transaction.cc | 28 +++-------------------
net/url_request/url_request_http_job.cc | 26 ++++++++++++--------
10 files changed, 62 insertions(+), 47 deletions(-)
10 files changed, 65 insertions(+), 47 deletions(-)
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -461,6 +461,13 @@ const FeatureEntry::FeatureVariation kCCTModuleCacheVariations[] = {
@@ -461,6 +461,14 @@ const FeatureEntry::FeatureVariation kCCTModuleCacheVariations[] = {
base::size(kCCTModuleCache_ThirtyMinutes), nullptr},
};
@@ -31,13 +32,14 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
+ {features::kDnsOverHttpsChoiceDefault, "", ""},
+ {features::kDnsOverHttpsChoiceGoogle, switches::kDnsOverHttpsServer, "https://dns.google.com/experimental"},
+ {features::kDnsOverHttpsChoiceCloudflare, switches::kDnsOverHttpsServer, "https://1.1.1.1/dns-query"},
+ {features::kDnsOverHttpsChoiceQuad9, switches::kDnsOverHttpsServer, "https://9.9.9.9/dns-query"}
+ {features::kDnsOverHttpsChoiceQuad9, switches::kDnsOverHttpsServer, "https://9.9.9.9/dns-query"},
+ {features::kDnsOverHttpsChoiceAdGuard, switches::kDnsOverHttpsServer, "https://dns.adguard.com/dns-query"}
+};
+
#endif // OS_ANDROID
const FeatureEntry::Choice kNumRasterThreadsChoices[] = {
@@ -3659,6 +3666,12 @@ const FeatureEntry kFeatureEntries[] = {
@@ -3659,6 +3667,12 @@ const FeatureEntry kFeatureEntries[] = {
FEATURE_VALUE_TYPE(features::kAsyncDns)},
#endif // defined(OS_ANDROID)
@@ -112,7 +114,7 @@ diff --git a/chrome/browser/net/system_network_context_manager.cc b/chrome/brows
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,7 +10,9 @@ namespace features {
@@ -10,7 +10,10 @@ namespace features {
const base::Feature kChannelID{"channel-id", base::FEATURE_DISABLED_BY_DEFAULT};
@@ -121,13 +123,14 @@ diff --git a/components/network_session_configurator/common/network_features.cc
+const char kDnsOverHttpsChoiceDefault[] = "Disabled",
+ kDnsOverHttpsChoiceGoogle[] = "Google",
+ kDnsOverHttpsChoiceCloudflare[] = "Cloudflare",
+ kDnsOverHttpsChoiceQuad9[] = "Quad9";
+ kDnsOverHttpsChoiceQuad9[] = "Quad9",
+ kDnsOverHttpsChoiceAdGuard[] = "AdGuard";
} // namespace features
diff --git a/components/network_session_configurator/common/network_features.h b/components/network_session_configurator/common/network_features.h
--- a/components/network_session_configurator/common/network_features.h
+++ b/components/network_session_configurator/common/network_features.h
@@ -13,9 +13,11 @@ namespace features {
@@ -13,9 +13,12 @@ namespace features {
// Enables Channel ID.
NETWORK_SESSION_CONFIGURATOR_EXPORT extern const base::Feature kChannelID;
@@ -136,7 +139,8 @@ diff --git a/components/network_session_configurator/common/network_features.h b
// (https://tools.ietf.org/id/draft-ietf-doh-dns-over-https-12.txt).
NETWORK_SESSION_CONFIGURATOR_EXPORT extern const base::Feature kDnsOverHttps;
+NETWORK_SESSION_CONFIGURATOR_EXPORT extern const char kDnsOverHttpsChoiceDefault[],
+ kDnsOverHttpsChoiceGoogle[], kDnsOverHttpsChoiceCloudflare[], kDnsOverHttpsChoiceQuad9[];
+ kDnsOverHttpsChoiceGoogle[], kDnsOverHttpsChoiceCloudflare[], kDnsOverHttpsChoiceQuad9[],
+ kDnsOverHttpsChoiceAdGuard[];
} // namespace features
File diff suppressed because it is too large Load Diff
@@ -19,18 +19,18 @@ clicked links to launch as incognito.
diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml
--- a/chrome/android/java/res/xml/privacy_preferences.xml
+++ b/chrome/android/java/res/xml/privacy_preferences.xml
@@ -23,6 +23,11 @@
android:summary="@string/close_tabs_on_exit_summary"
android:defaultValue="false" />
<org.chromium.chrome.browser.preferences.ChromeBaseCheckBoxPreference
@@ -35,6 +35,11 @@
android:key="usage_and_crash_reports"
android:title="@string/usage_and_crash_reports_title_legacy"
android:fragment="org.chromium.chrome.browser.preferences.privacy.UsageAndCrashReportsPreferenceFragment" />
+ <org.chromium.chrome.browser.preferences.ChromeBaseCheckBoxPreference
+ android:key="always_incognito"
+ android:title="@string/always_incognito_title"
+ android:summary="@string/always_incognito_summary"
+ android:defaultValue="false" />
+ <org.chromium.chrome.browser.preferences.ChromeBaseCheckBoxPreference
android:key="safe_browsing_extended_reporting"
android:title="@string/safe_browsing_extended_reporting_title"
android:summary="@string/safe_browsing_extended_reporting_summary" />
<Preference
android:fragment="org.chromium.chrome.browser.preferences.privacy.DoNotTrackPreference"
android:key="do_not_track"
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/AlwaysIncognitoLinkInterceptor.java b/chrome/android/java/src/org/chromium/chrome/browser/AlwaysIncognitoLinkInterceptor.java
new file mode 100644
--- /dev/null
@@ -358,7 +358,7 @@ diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
"bookmarks/bookmark_model_factory.cc",
"bookmarks/bookmark_model_factory.h",
"bookmarks/bookmark_stats.cc",
@@ -2586,8 +2590,6 @@ jumbo_split_static_library("browser") {
@@ -2588,8 +2592,6 @@ jumbo_split_static_library("browser") {
"banners/app_banner_infobar_delegate_desktop.h",
"banners/app_banner_manager_desktop.cc",
"banners/app_banner_manager_desktop.h",
@@ -26,7 +26,7 @@ diff --git a/chrome/android/java/res/values/values.xml b/chrome/android/java/res
diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml
--- a/chrome/android/java/res/xml/privacy_preferences.xml
+++ b/chrome/android/java/res/xml/privacy_preferences.xml
@@ -55,6 +55,11 @@
@@ -43,6 +43,11 @@
android:title="@string/clear_browsing_data_title"
android:summary="@string/clear_browsing_data_summary"
android:fragment="org.chromium.chrome.browser.preferences.privacy.ClearBrowsingDataTabsFragment" />
@@ -60,37 +60,37 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDis
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferences.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferences.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferences.java
@@ -42,6 +42,7 @@ public class PrivacyPreferences extends PreferenceFragment
"safe_browsing_extended_reporting";
private static final String PREF_SAFE_BROWSING_SCOUT_REPORTING =
"safe_browsing_scout_reporting";
@@ -38,6 +38,7 @@ public class PrivacyPreferences extends PreferenceFragment
implements OnPreferenceChangeListener {
private static final String PREF_NAVIGATION_ERROR = "navigation_error";
private static final String PREF_SEARCH_SUGGESTIONS = "search_suggestions";
+ public static final String PREF_ALLOW_CUSTOM_TAB_INTENTS = "allow_custom_tab_intents";
private static final String PREF_SAFE_BROWSING = "safe_browsing";
private static final String PREF_CAN_MAKE_PAYMENT = "can_make_payment";
private static final String PREF_CONTEXTUAL_SEARCH = "contextual_search";
@@ -135,6 +136,11 @@ public class PrivacyPreferences extends PreferenceFragment
? PREF_SAFE_BROWSING_EXTENDED_REPORTING : PREF_SAFE_BROWSING_SCOUT_REPORTING;
preferenceScreen.removePreference(findPreference(extended_reporting_pref_to_remove));
private static final String PREF_NETWORK_PREDICTIONS = "network_predictions";
@@ -101,6 +102,11 @@ public class PrivacyPreferences extends PreferenceFragment
navigationErrorPref.setOnPreferenceChangeListener(this);
navigationErrorPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
+ ChromeBaseCheckBoxPreference allowCustomTabIntentsPref =
+ (ChromeBaseCheckBoxPreference) findPreference(PREF_ALLOW_CUSTOM_TAB_INTENTS);
+ allowCustomTabIntentsPref.setOnPreferenceChangeListener(this);
+ allowCustomTabIntentsPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
+
ChromeBaseCheckBoxPreference safeBrowsingPref =
(ChromeBaseCheckBoxPreference) findPreference(PREF_SAFE_BROWSING);
safeBrowsingPref.setOnPreferenceChangeListener(this);
@@ -154,6 +160,10 @@ public class PrivacyPreferences extends PreferenceFragment
|| PREF_SAFE_BROWSING_SCOUT_REPORTING.equals(key)) {
PrefServiceBridge.getInstance().setSafeBrowsingExtendedReportingEnabled(
(boolean) newValue);
ChromeBaseCheckBoxPreference searchSuggestionsPref =
(ChromeBaseCheckBoxPreference) findPreference(PREF_SEARCH_SUGGESTIONS);
searchSuggestionsPref.setOnPreferenceChangeListener(this);
@@ -123,6 +129,10 @@ public class PrivacyPreferences extends PreferenceFragment
recordNetworkPredictionEnablingUMA((boolean) newValue);
} else if (PREF_NAVIGATION_ERROR.equals(key)) {
PrefServiceBridge.getInstance().setResolveNavigationErrorEnabled((boolean) newValue);
+ } else if (PREF_ALLOW_CUSTOM_TAB_INTENTS.equals(key)) {
+ SharedPreferences.Editor sharedPreferencesEditor = ContextUtils.getAppSharedPreferences().edit();
+ sharedPreferencesEditor.putBoolean(PREF_ALLOW_CUSTOM_TAB_INTENTS, (boolean)newValue);
+ sharedPreferencesEditor.apply();
} else if (PREF_NETWORK_PREDICTIONS.equals(key)) {
PrefServiceBridge.getInstance().setNetworkPredictionEnabled((boolean) newValue);
recordNetworkPredictionEnablingUMA((boolean) newValue);
} else if (PREF_CAN_MAKE_PAYMENT.equals(key)) {
PrefServiceBridge.getInstance().setBoolean(
Pref.CAN_MAKE_PAYMENT_ENABLED, (boolean) newValue);
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
@@ -18,7 +18,7 @@ with limited CPU/memory resources and it is disabled by default.
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -963,6 +963,11 @@ const FeatureEntry::Choice kForceEffectiveConnectionTypeChoices[] = {
@@ -964,6 +964,11 @@ const FeatureEntry::Choice kForceEffectiveConnectionTypeChoices[] = {
net::kEffectiveConnectionType4G},
};
@@ -30,7 +30,7 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
// Ensure that all effective connection types returned by Network Quality
// Estimator (NQE) are also exposed via flags.
static_assert(net::EFFECTIVE_CONNECTION_TYPE_LAST + 2 ==
@@ -2606,6 +2611,9 @@ const FeatureEntry kFeatureEntries[] = {
@@ -2607,6 +2612,9 @@ const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kMaterialDesignIncognitoNTPName,
flag_descriptions::kMaterialDesignIncognitoNTPDescription, kOsAndroid,
FEATURE_VALUE_TYPE(features::kMaterialDesignIncognitoNTP)},
@@ -14,7 +14,7 @@ Subject: Add flag to disable IPv6 probes
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -3498,6 +3498,11 @@ const FeatureEntry kFeatureEntries[] = {
@@ -3499,6 +3499,11 @@ const FeatureEntry kFeatureEntries[] = {
FEATURE_VALUE_TYPE(features::kEnableVirtualKeyboardUkm)},
#endif // OS_CHROMEOS
@@ -26,8 +26,8 @@ diff --git a/chrome/android/java/res/values/values.xml b/chrome/android/java/res
diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml
--- a/chrome/android/java/res/xml/privacy_preferences.xml
+++ b/chrome/android/java/res/xml/privacy_preferences.xml
@@ -18,6 +18,11 @@
android:summary="@string/search_suggestions_summary"
@@ -13,6 +13,11 @@
android:summary="@string/navigation_error_summary"
android:defaultValue="true" />
<org.chromium.chrome.browser.preferences.ChromeBaseCheckBoxPreference
+ android:key="close_tabs_on_exit"
@@ -35,9 +35,9 @@ diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/androi
+ android:summary="@string/close_tabs_on_exit_summary"
+ android:defaultValue="false" />
+ <org.chromium.chrome.browser.preferences.ChromeBaseCheckBoxPreference
android:key="safe_browsing_extended_reporting"
android:title="@string/safe_browsing_extended_reporting_title"
android:summary="@string/safe_browsing_extended_reporting_summary" />
android:key="search_suggestions"
android:title="@string/search_suggestions_title"
android:summary="@string/search_suggestions_summary"
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
@@ -72,7 +72,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/pri
import org.chromium.base.metrics.RecordHistogram;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.ChromeFeatureList;
@@ -47,6 +49,7 @@ public class PrivacyPreferences extends PreferenceFragment
@@ -42,6 +44,7 @@ public class PrivacyPreferences extends PreferenceFragment
private static final String PREF_CAN_MAKE_PAYMENT = "can_make_payment";
private static final String PREF_CONTEXTUAL_SEARCH = "contextual_search";
private static final String PREF_NETWORK_PREDICTIONS = "network_predictions";
@@ -80,19 +80,19 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/pri
private static final String PREF_DO_NOT_TRACK = "do_not_track";
private static final String PREF_USAGE_AND_CRASH_REPORTING = "usage_and_crash_reports";
private static final String PREF_CLEAR_BROWSING_DATA = "clear_browsing_data";
@@ -146,6 +149,11 @@ public class PrivacyPreferences extends PreferenceFragment
safeBrowsingPref.setOnPreferenceChangeListener(this);
safeBrowsingPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
@@ -91,6 +94,11 @@ public class PrivacyPreferences extends PreferenceFragment
preferenceScreen.removePreference(findPreference(PREF_SYNC_AND_SERVICES_LINK_DIVIDER));
preferenceScreen.removePreference(findPreference(PREF_SYNC_AND_SERVICES_LINK));
+ ChromeBaseCheckBoxPreference closeTabsOnExitPref =
+ (ChromeBaseCheckBoxPreference) findPreference(PREF_CLOSE_TABS_ON_EXIT);
+ closeTabsOnExitPref.setOnPreferenceChangeListener(this);
+ closeTabsOnExitPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
+
updateSummaries();
}
@@ -172,6 +180,12 @@ public class PrivacyPreferences extends PreferenceFragment
ChromeBaseCheckBoxPreference networkPredictionPref =
(ChromeBaseCheckBoxPreference) findPreference(PREF_NETWORK_PREDICTIONS);
networkPredictionPref.setChecked(prefServiceBridge.getNetworkPredictionEnabled());
@@ -136,6 +144,12 @@ public class PrivacyPreferences extends PreferenceFragment
} else if (PREF_CAN_MAKE_PAYMENT.equals(key)) {
PrefServiceBridge.getInstance().setBoolean(
Pref.CAN_MAKE_PAYMENT_ENABLED, (boolean) newValue);
@@ -8,15 +8,15 @@ Subject: Allow building without safebrowsing for Android
.../chrome_browsing_data_remover_delegate.cc | 10 ----
chrome/browser/chrome_content_browser_client.cc | 14 +-----
.../chrome_resource_dispatcher_host_delegate.cc | 4 ++
chrome/browser/net/chrome_network_delegate.cc | 13 -----
6 files changed, 5 insertions(+), 106 deletions(-)
chrome/browser/net/chrome_network_delegate.cc | 35 +------------
6 files changed, 7 insertions(+), 126 deletions(-)
diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml
--- a/chrome/android/java/res/xml/privacy_preferences.xml
+++ b/chrome/android/java/res/xml/privacy_preferences.xml
@@ -28,18 +28,6 @@
android:summary="@string/always_incognito_summary"
android:defaultValue="false" />
@@ -18,18 +18,6 @@
android:summary="@string/search_suggestions_summary"
android:defaultValue="true" />
<org.chromium.chrome.browser.preferences.ChromeBaseCheckBoxPreference
- android:key="safe_browsing_extended_reporting"
- android:title="@string/safe_browsing_extended_reporting_title"
@@ -36,7 +36,7 @@ diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/androi
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferences.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferences.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferences.java
@@ -40,12 +40,7 @@ public class PrivacyPreferences extends PreferenceFragment
@@ -38,11 +38,6 @@ public class PrivacyPreferences extends PreferenceFragment
implements OnPreferenceChangeListener {
private static final String PREF_NAVIGATION_ERROR = "navigation_error";
private static final String PREF_SEARCH_SUGGESTIONS = "search_suggestions";
@@ -44,12 +44,11 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/pri
- "safe_browsing_extended_reporting";
- private static final String PREF_SAFE_BROWSING_SCOUT_REPORTING =
- "safe_browsing_scout_reporting";
public static final String PREF_ALLOW_CUSTOM_TAB_INTENTS = "allow_custom_tab_intents";
- private static final String PREF_SAFE_BROWSING = "safe_browsing";
private static final String PREF_CAN_MAKE_PAYMENT = "can_make_payment";
private static final String PREF_CONTEXTUAL_SEARCH = "contextual_search";
private static final String PREF_NETWORK_PREDICTIONS = "network_predictions";
@@ -80,10 +75,6 @@ public class PrivacyPreferences extends PreferenceFragment
@@ -76,10 +71,6 @@ public class PrivacyPreferences extends PreferenceFragment
// Remove preferences that were migrated to SyncAndServicesPreferences.
preferenceScreen.removePreference(findPreference(PREF_NAVIGATION_ERROR));
preferenceScreen.removePreference(findPreference(PREF_SEARCH_SUGGESTIONS));
@@ -60,7 +59,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/pri
preferenceScreen.removePreference(findPreference(PREF_NETWORK_PREDICTIONS));
preferenceScreen.removePreference(findPreference(PREF_CONTEXTUAL_SEARCH));
preferenceScreen.removePreference(findPreference(PREF_USAGE_AND_CRASH_REPORTING));
@@ -123,32 +114,11 @@ public class PrivacyPreferences extends PreferenceFragment
@@ -119,27 +110,6 @@ public class PrivacyPreferences extends PreferenceFragment
preferenceScreen.removePreference(findPreference(PREF_CONTEXTUAL_SEARCH));
}
@@ -80,20 +79,15 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/pri
- ? PREF_SAFE_BROWSING_EXTENDED_REPORTING : PREF_SAFE_BROWSING_SCOUT_REPORTING;
- preferenceScreen.removePreference(findPreference(extended_reporting_pref_to_remove));
-
ChromeBaseCheckBoxPreference allowCustomTabIntentsPref =
(ChromeBaseCheckBoxPreference) findPreference(PREF_ALLOW_CUSTOM_TAB_INTENTS);
allowCustomTabIntentsPref.setOnPreferenceChangeListener(this);
allowCustomTabIntentsPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
- ChromeBaseCheckBoxPreference safeBrowsingPref =
- (ChromeBaseCheckBoxPreference) findPreference(PREF_SAFE_BROWSING);
- safeBrowsingPref.setOnPreferenceChangeListener(this);
- safeBrowsingPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
-
ChromeBaseCheckBoxPreference closeTabsOnExitPref =
(ChromeBaseCheckBoxPreference) findPreference(PREF_CLOSE_TABS_ON_EXIT);
closeTabsOnExitPref.setOnPreferenceChangeListener(this);
@@ -162,12 +132,6 @@ public class PrivacyPreferences extends PreferenceFragment
updateSummaries();
}
@@ -148,12 +118,6 @@ public class PrivacyPreferences extends PreferenceFragment
String key = preference.getKey();
if (PREF_SEARCH_SUGGESTIONS.equals(key)) {
PrefServiceBridge.getInstance().setSearchSuggestEnabled((boolean) newValue);
@@ -103,10 +97,10 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/pri
- || PREF_SAFE_BROWSING_SCOUT_REPORTING.equals(key)) {
- PrefServiceBridge.getInstance().setSafeBrowsingExtendedReportingEnabled(
- (boolean) newValue);
} else if (PREF_ALLOW_CUSTOM_TAB_INTENTS.equals(key)) {
SharedPreferences.Editor sharedPreferencesEditor = ContextUtils.getAppSharedPreferences().edit();
sharedPreferencesEditor.putBoolean(PREF_ALLOW_CUSTOM_TAB_INTENTS, (boolean)newValue);
@@ -226,21 +190,6 @@ public class PrivacyPreferences extends PreferenceFragment
} else if (PREF_NETWORK_PREDICTIONS.equals(key)) {
PrefServiceBridge.getInstance().setNetworkPredictionEnabled((boolean) newValue);
recordNetworkPredictionEnablingUMA((boolean) newValue);
@@ -202,21 +166,6 @@ public class PrivacyPreferences extends PreferenceFragment
searchSuggestionsPref.setChecked(prefServiceBridge.isSearchSuggestEnabled());
}
@@ -128,7 +122,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/pri
CheckBoxPreference canMakePaymentPref =
(CheckBoxPreference) findPreference(PREF_CAN_MAKE_PAYMENT);
if (canMakePaymentPref != null) {
@@ -277,13 +226,6 @@ public class PrivacyPreferences extends PreferenceFragment
@@ -253,13 +202,6 @@ public class PrivacyPreferences extends PreferenceFragment
if (PREF_SEARCH_SUGGESTIONS.equals(key)) {
return prefs.isSearchSuggestManaged();
}
@@ -165,7 +159,7 @@ diff --git a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.
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
@@ -4862,19 +4862,7 @@ ChromeContentBrowserClient::GetSafeBrowsingUrlCheckerDelegate(
@@ -4853,19 +4853,7 @@ ChromeContentBrowserClient::GetSafeBrowsingUrlCheckerDelegate(
content::ResourceContext* resource_context) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
@@ -211,7 +205,7 @@ diff --git a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc b
diff --git a/chrome/browser/net/chrome_network_delegate.cc b/chrome/browser/net/chrome_network_delegate.cc
--- a/chrome/browser/net/chrome_network_delegate.cc
+++ b/chrome/browser/net/chrome_network_delegate.cc
@@ -81,19 +81,6 @@ namespace {
@@ -79,19 +79,6 @@ namespace {
bool g_access_to_all_files_enabled = false;
@@ -231,6 +225,35 @@ diff --git a/chrome/browser/net/chrome_network_delegate.cc b/chrome/browser/net/
bool IsAccessAllowedInternal(const base::FilePath& path,
const base::FilePath& profile_path) {
if (g_access_to_all_files_enabled)
@@ -213,26 +200,8 @@ int ChromeNetworkDelegate::OnBeforeURLRequest(
GURL* new_url) {
extensions_delegate_->ForwardStartRequestStatus(request);
- // The non-redirect case is handled in GoogleURLLoaderThrottle.
- bool force_safe_search =
- (force_google_safe_search_ && force_google_safe_search_->GetValue() &&
- request->is_redirecting());
-
- net::CompletionOnceCallback wrapped_callback = std::move(callback);
-
- if (force_safe_search) {
- wrapped_callback = base::BindOnce(
- &ForceGoogleSafeSearchCallbackWrapper, std::move(wrapped_callback),
- base::Unretained(request), base::Unretained(new_url));
- }
-
- int rv = extensions_delegate_->NotifyBeforeURLRequest(
- request, std::move(wrapped_callback), new_url);
-
- if (force_safe_search && rv == net::OK && new_url->is_empty())
- safe_search_util::ForceGoogleSafeSearch(request->url(), new_url);
-
- return rv;
+ return extensions_delegate_->NotifyBeforeURLRequest(
+ request, std::move(callback), new_url);
}
int ChromeNetworkDelegate::OnBeforeStartTransaction(
--
2.11.0
@@ -18,12 +18,12 @@ New mechanism for adblocking based on Brave's adblocking hook
.../browser/appmenu/AppMenuPropertiesDelegate.java | 38 +++
.../CustomTabAppMenuPropertiesDelegate.java | 2 +
.../java/strings/android_chrome_strings.grd | 11 +
chrome/browser/net/chrome_network_delegate.cc | 83 ++++--
chrome/browser/net/chrome_network_delegate.cc | 83 +++--
.../subresource_filter_content_settings_manager.cc | 1 +
net/BUILD.gn | 7 +
net/url_request/adblock_intercept.cc | 325 +++++++++++++++++++++
net/url_request/adblock_intercept.h | 24 ++
12 files changed, 510 insertions(+), 20 deletions(-)
net/url_request/adblock_intercept.cc | 341 +++++++++++++++++++++
net/url_request/adblock_intercept.h | 41 +++
12 files changed, 543 insertions(+), 20 deletions(-)
create mode 100644 net/url_request/adblock_intercept.cc
create mode 100644 net/url_request/adblock_intercept.h
@@ -213,7 +213,7 @@ diff --git a/chrome/browser/net/chrome_network_delegate.cc b/chrome/browser/net/
#endif
#if defined(OS_CHROMEOS)
@@ -207,34 +209,75 @@ void ChromeNetworkDelegate::set_cookie_settings(
@@ -194,34 +196,75 @@ void ChromeNetworkDelegate::set_cookie_settings(
cookie_settings_ = cookie_settings;
}
@@ -341,7 +341,23 @@ 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,325 @@
@@ -0,0 +1,341 @@
+/*
+ This file is part of Bromite.
+
+ Bromite is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Bromite is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Bromite. If not, see <https://www.gnu.org/licenses/>.
+*/
+#include "url/gurl.h"
+
+#ifdef ADB_TESTER
@@ -671,7 +687,24 @@ diff --git a/net/url_request/adblock_intercept.h b/net/url_request/adblock_inter
new file mode 100644
--- /dev/null
+++ b/net/url_request/adblock_intercept.h
@@ -0,0 +1,24 @@
@@ -0,0 +1,41 @@
+/*
+ This file is part of Bromite.
+
+ Bromite is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Bromite is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Bromite. If not, see <https://www.gnu.org/licenses/>.
+*/
+
+#ifndef NET_URL_REQUEST_ADBLOCK_INTERCEPT_H_
+#define NET_URL_REQUEST_ADBLOCK_INTERCEPT_H_
+
@@ -10,7 +10,7 @@ Set #enable-history-entry-requires-user-gesture to enabled by default
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -1510,7 +1510,7 @@ const FeatureEntry kFeatureEntries[] = {
@@ -1511,7 +1511,7 @@ const FeatureEntry kFeatureEntries[] = {
{"enable-history-entry-requires-user-gesture",
flag_descriptions::kHistoryRequiresUserGestureName,
flag_descriptions::kHistoryRequiresUserGestureDescription, kOsAll,
@@ -2,16 +2,16 @@ From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sat, 28 Oct 2017 10:09:41 +0200
Subject: Inject scripts for AMP, tracking, ads and video functionality
Remove AMP, tracking and ads from search results
Remove AMP, tracking and ads from search/news results
Break Page Visibility API and Fullscreen API for youtube.com and vimeo.com to
allow playing videos in background (original Javascript code by timdream)
Send a random key press to circumvent idle status detection
---
third_party/blink/renderer/core/dom/BUILD.gn | 2 ++
third_party/blink/renderer/core/dom/document.cc | 28 +++++++++++++++++++++-
.../renderer/core/dom/extensions/anti_amp_cure.h | 6 +++++
.../renderer/core/dom/extensions/video_bg_play.h | 6 +++++
4 files changed, 41 insertions(+), 1 deletion(-)
third_party/blink/renderer/core/dom/document.cc | 32 +++++++++++++++++++++-
.../renderer/core/dom/extensions/anti_amp_cure.h | 6 ++++
.../renderer/core/dom/extensions/video_bg_play.h | 6 ++++
4 files changed, 45 insertions(+), 1 deletion(-)
create mode 100644 third_party/blink/renderer/core/dom/extensions/anti_amp_cure.h
create mode 100644 third_party/blink/renderer/core/dom/extensions/video_bg_play.h
@@ -22,8 +22,8 @@ diff --git a/third_party/blink/renderer/core/dom/BUILD.gn b/third_party/blink/re
"global_event_handlers.h",
"icon_url.cc",
"icon_url.h",
+ "extensions/dont-track-me.h",
+ "extensions/video-bg-play.h",
+ "extensions/anti_amp_cure.h",
+ "extensions/video_bg_play.h",
"id_target_observer.cc",
"id_target_observer.h",
"id_target_observer_registry.cc",
@@ -47,7 +47,7 @@ diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink
#ifndef NDEBUG
using WeakDocumentSet = blink::HeapHashSet<blink::WeakMember<blink::Document>>;
static WeakDocumentSet& liveDocumentSet();
@@ -6088,8 +6091,31 @@ void Document::FinishedParsing() {
@@ -6088,8 +6091,35 @@ void Document::FinishedParsing() {
fetcher_->ClearResourcesFromPreviousFetcher();
}
@@ -57,12 +57,16 @@ diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink
+ return;
+ }
+
+ // determine whether this is a Google search results page
+ // determine whether this is a search results page
+ const WTF::String& host = url_.Host();
+ if ((host == nullptr) || host.IsEmpty())
+ return;
+
+ LOG(INFO) << "checking URL host for possible injections: " << host;
+ auto* bodyElement = body();
+ if (bodyElement) {
+ size_t pos = host.Find(".google.");
+ if ((pos != WTF::kNotFound) && (host.length() - pos - 8 < 4)) {
+ size_t pos1 = host.Find("www.google."), pos2 = host.Find("news.google.");
+ if ((pos1 == 0) || (pos2 == 0)) {
+ LOG(INFO) << "injecting anti-AMP-cure Javascript payload, URL: " << url_.GetString();
+ HTMLScriptElement* e = HTMLScriptElement::Create(*this, CreateElementFlags());
+ e->setText(ANTI_AMP_CURE_JS);
@@ -88,7 +92,7 @@ new file mode 100644
+#ifndef anti_amp_cure_h
+#define anti_amp_cure_h
+
+#define ANTI_AMP_CURE_JS "/* Bromite click-tracking and AMP removal v0.3.5 */\n\nfunction recreateHyperlink(a) {\n // skip already-sanitized hyperlinks\n if (a.sane) return false;\n\n // create new A element - old one has event listeners attached\n var newA = document.createElement('a');\n newA.referrerPolicy = 'origin';\n // property set when hyperlink has been created by this script\n newA.sane = 1;\n\n // remove AMP class, get actual page URL\n var ampCur = a.getAttribute('data-amp-cur');\n if (ampCur) {\n newA.href = ampCur;\n a.classList.remove('amp_r');\n } else {\n var realLink = getRealLinkFromGoogleUrl(a);\n if (realLink) {\n newA.href = realLink;\n } else {\n // might not be an actual hyperlink, ignore it\n if (!a.href) {\n return false;\n }\n // leave original href unchanged\n newA.href = a.href;\n }\n }\n // copy CSS classes\n newA.className = a.className;\n\n // copy nodes inside the hyperlink\n while (a.firstChild) {\n newA.appendChild(a.lastChild);\n }\n // replace hyperlink\n a.parentNode.replaceChild(newA, a);\n return true;\n}\n\nfunction isResult(a) {\n if (a.getAttribute('data-amp-cur'))\n return true;\n var inlineMousedown = a.getAttribute('onmousedown');\n if (!inlineMousedown)\n\treturn false;\n // return rwt(....); // E.g Google search results.\n // return google.rwt(...); // E.g. sponsored search results\n // return google.arwt(this); // E.g. sponsored search results (dec 2016).\n return /\\ba?rwt\\(/.test(inlineMousedown) || /\\bctpacw\\b/.test(inlineMousedown);\n}\n\n/**\n * @returns {String} the real URL if the given link is a Google redirect URL.\n */\nfunction getRealLinkFromGoogleUrl(a) {\n if ((a.hostname === location.hostname || a.hostname.indexOf('www.google.') == 0) &&\n /^\\/(local_)?url$/.test(a.pathname)) {\n // Google Maps / Dito (/local_url?q=<url>)\n // Mobile (/url?q=<url>)\n var url = /[?&](?:q|url)=((?:https?|ftp)[%:][^&]+)/.exec(a.search);\n if (url) {\n return decodeURIComponent(url[1]);\n }\n // Help pages, e.g. safe browsing (/url?...&q=%2Fsupport%2Fanswer...)\n url = /[?&](?:q|url)=((?:%2[Ff]|\\/)[^&]+)/.exec(a.search);\n if (url) {\n return a.origin + decodeURIComponent(url[1]);\n }\n }\n}\n\nfunction sanitizeAds() {\n // scan all divs\n var div = document.getElementById('tads');\n if (div) {\n div.style.display = 'none';\n\treturn true;\n }\n return false;\n}\n\nfunction sanitizeAll() {\n console.log(\"ads removed: \", sanitizeAds());\n console.log(\"hyperlinks sanitized: \", sanitizeAllHyperlinks(document));\n}\n\nfunction hookMoreResults() {\n var extrares = document.getElementById('extrares');\n if (!extrares) {\n console.log(\"could not hook more results\");\n return;\n }\n // mutation observers are great but they don't work\n extrares.addEventListener(\"DOMNodeInserted\", function(e) {\n var node = e.target;\n if (node.id && node.id.startsWith(\"arc-srp\"))\n console.log(\"hyperlinks sanitized on new result node: \", sanitizeAllHyperlinks(node));\n });\n}\n\nfunction setMlogoClick() {\n var mlogo = document.getElementById('qslc');\n if (mlogo && mlogo.children[0]) {\n mlogo = mlogo.children[0];\n mlogo.removeAttribute(\"href\");\n mlogo.setAttribute(\"onclick\", \"sanitizeAll()\");\n console.log(\"logo link replaced\");\n } else {\n console.log(\"could not replace logo link\");\n }\n}\n\nfunction sanitizeAllHyperlinks(rootNode) {\n var saned = 0, total = 0;\n rootNode.querySelectorAll('div[data-hveid]:not([data-hveid=\"\"]) a').forEach(function(a) {\n\ttotal++;\n\tvar res = recreateHyperlink(a);\n\tif (res) saned++;\n });\n console.log(\"sanitized \", saned, \"/\", total, \" hyperlinks\");\n\n return saned;\n}\n\n// avoid running cleanup on non-search pages\nif ((document.location.host.indexOf(\"images.google.\") == -1) && \n (document.location.host.indexOf(\"accounts.google.\") == -1) &&\n (document.location.host.indexOf(\"news.google.\") == -1)) {\n sanitizeAll();\n}\nsetMlogoClick();\n\nhookMoreResults();\n"
+#define ANTI_AMP_CURE_JS "/* Bromite click-tracking and AMP removal v0.3.6 */\n\nfunction recreateHyperlink(a) {\n // skip already-sanitized hyperlinks\n if (a.sane) return false;\n\n // create new A element - old one has event listeners attached\n var newA = document.createElement('a');\n newA.referrerPolicy = 'origin';\n // property set when hyperlink has been created by this script\n newA.sane = 1;\n\n // remove AMP class, get actual page URL\n var ampCur = a.getAttribute('data-amp-cur');\n if (ampCur) {\n newA.href = ampCur;\n a.classList.remove('amp_r');\n } else {\n var realLink = getRealLinkFromGoogleUrl(a);\n if (realLink) {\n newA.href = realLink;\n } else {\n // might not be an actual hyperlink, ignore it\n if (!a.href) {\n return false;\n }\n // leave original href unchanged\n newA.href = a.href;\n }\n }\n // copy CSS classes\n newA.className = a.className;\n\n // copy nodes inside the hyperlink\n while (a.firstChild) {\n newA.appendChild(a.lastChild);\n }\n // replace hyperlink\n a.parentNode.replaceChild(newA, a);\n return true;\n}\n\nfunction isResult(a) {\n if (a.getAttribute('data-amp-cur'))\n return true;\n var inlineMousedown = a.getAttribute('onmousedown');\n if (!inlineMousedown)\n\treturn false;\n // return rwt(....); // E.g Google search results.\n // return google.rwt(...); // E.g. sponsored search results\n // return google.arwt(this); // E.g. sponsored search results (dec 2016).\n return /\\ba?rwt\\(/.test(inlineMousedown) || /\\bctpacw\\b/.test(inlineMousedown);\n}\n\n/**\n * @returns {String} the real URL if the given link is a Google redirect URL.\n */\nfunction getRealLinkFromGoogleUrl(a) {\n if ((a.hostname === location.hostname || a.hostname.indexOf('www.google.') == 0) &&\n /^\\/(local_)?url$/.test(a.pathname)) {\n // Google Maps / Dito (/local_url?q=<url>)\n // Mobile (/url?q=<url>)\n var url = /[?&](?:q|url)=((?:https?|ftp)[%:][^&]+)/.exec(a.search);\n if (url) {\n return decodeURIComponent(url[1]);\n }\n // Help pages, e.g. safe browsing (/url?...&q=%2Fsupport%2Fanswer...)\n url = /[?&](?:q|url)=((?:%2[Ff]|\\/)[^&]+)/.exec(a.search);\n if (url) {\n return a.origin + decodeURIComponent(url[1]);\n }\n }\n}\n\nfunction sanitizeAds() {\n // scan all divs\n var div = document.getElementById('tads');\n if (div) {\n div.style.display = 'none';\n\treturn true;\n }\n return false;\n}\n\nfunction hookMoreResults() {\n var extrares = document.getElementById('extrares');\n if (!extrares) {\n console.log(\"could not hook more results\");\n return;\n }\n // mutation observers are great but they don't work\n extrares.addEventListener(\"DOMNodeInserted\", function(e) {\n var node = e.target;\n if (node.id && node.id.startsWith(\"arc-srp\"))\n console.log(\"hyperlinks sanitized on new result node: \", sanitizeAllHyperlinks(node));\n });\n}\n\nfunction setMlogoClick() {\n var mlogo = document.getElementById('qslc');\n if (mlogo && mlogo.children[0]) {\n mlogo = mlogo.children[0];\n } else {\n mlogo = document.getElementById('mlogo');\n }\n if (mlogo) {\n mlogo.removeAttribute(\"href\");\n mlogo.setAttribute(\"onclick\", \"sanitizeAll()\");\n console.log(\"logo link replaced\");\n } else {\n console.log(\"could not replace logo link\");\n }\n}\n\nfunction sanitizeAllHyperlinks(rootNode) {\n var saned = 0, total = 0;\n // selector for both results and news\n rootNode.querySelectorAll('div[data-hveid]:not([data-hveid=\"\"]) a, div[data-ved]:not([data-ved=\"\"]) a').forEach(function(a) {\n\ttotal++;\n\tvar res = recreateHyperlink(a);\n\tif (res) saned++;\n });\n console.log(\"sanitized \", saned, \"/\", total, \" hyperlinks\");\n\n return saned;\n}\n\nfunction sanitizeAll() {\n console.log(\"ads removed: \", sanitizeAds());\n console.log(\"hyperlinks sanitized: \", sanitizeAllHyperlinks(document));\n}\n\n// avoid running cleanup on non-search pages\nif ((document.location.host.indexOf(\"images.google.\") == -1) &&\n (document.location.host.indexOf(\"accounts.google.\") == -1)) {\n sanitizeAll();\n}\nsetMlogoClick();\n\nhookMoreResults();\n"
+
+#endif // anti_amp_cure_h
diff --git a/third_party/blink/renderer/core/dom/extensions/video_bg_play.h b/third_party/blink/renderer/core/dom/extensions/video_bg_play.h
@@ -36,7 +36,7 @@ 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
@@ -1055,7 +1055,7 @@ void ChromeContentBrowserClient::RegisterLocalStatePrefs(
@@ -1053,7 +1053,7 @@ void ChromeContentBrowserClient::RegisterLocalStatePrefs(
void ChromeContentBrowserClient::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(prefs::kDisable3DAPIs, false);
@@ -0,0 +1,118 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sat, 10 Nov 2018 16:09:26 +0100
Subject: Reduce permissions needed for bookmarks import/export
Completely remove contacts picker permission from the file dialog
---
chrome/android/java/AndroidManifest.xml | 1 -
chrome/browser/android/bookmarks/bookmark_bridge.cc | 20 +++++++++++++++++---
.../src/org/chromium/ui/base/SelectFileDialog.java | 12 ++++++++----
3 files changed, 25 insertions(+), 8 deletions(-)
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
@@ -35,7 +35,6 @@ by a child template that "extends" this file.
{% endif %}
<uses-permission-sdk-23 android:name="android.permission.BLUETOOTH"/>
<uses-permission-sdk-23 android:name="android.permission.BLUETOOTH_ADMIN"/>
- <uses-permission-sdk-23 android:name="android.permission.READ_CONTACTS"/>
<uses-permission-sdk-23 android:name="android.permission.REORDER_TASKS"/>
<uses-permission-sdk-23 android:name="android.permission.REQUEST_INSTALL_PACKAGES"/>
diff --git a/chrome/browser/android/bookmarks/bookmark_bridge.cc b/chrome/browser/android/bookmarks/bookmark_bridge.cc
--- a/chrome/browser/android/bookmarks/bookmark_bridge.cc
+++ b/chrome/browser/android/bookmarks/bookmark_bridge.cc
@@ -552,14 +552,23 @@ void BookmarkBridge::ImportBookmarks(JNIEnv* env,
select_file_dialog_ = ui::SelectFileDialog::Create(
this, std::make_unique<ChromeSelectFilePolicy>(nullptr));
- //NOTE: extension and description are not used on Android
+ //NOTE: extension and description are not used on Android, thus not set
ui::SelectFileDialog::FileTypeInfo file_type_info;
+
+#if defined(OS_ANDROID)
+ static const std::vector<base::string16> v_accept_types = { base::UTF8ToUTF16("text/html") };
+
+ // Android needs the original MIME types and an additional capture value.
+ std::pair<std::vector<base::string16>, bool> accept_types =
+ std::make_pair(v_accept_types, /* use_media_capture */ false);
+#else
file_type_info.extensions.resize(1);
file_type_info.extensions[0].push_back(FILE_PATH_LITERAL("html"));
file_type_info.extensions[0].push_back(FILE_PATH_LITERAL("htm"));
file_type_info.extension_description_overrides.push_back(base::ASCIIToUTF16("Netscape Bookmark"));
file_type_info.allowed_paths =
- ui::SelectFileDialog::FileTypeInfo::NATIVE_OR_DRIVE_PATH;
+ ui::SelectFileDialog::FileTypeInfo::ANY_PATH;
+#endif
select_file_dialog_->SelectFile(
ui::SelectFileDialog::SELECT_OPEN_FILE,
@@ -569,7 +578,12 @@ void BookmarkBridge::ImportBookmarks(JNIEnv* env,
0,
base::FilePath::StringType(),
window,
- NULL);
+#if defined(OS_ANDROID)
+ &accept_types
+#else
+ NULL
+#endif
+);
//NOTE: this should be called after the actual import
Java_BookmarkBridge_bookmarksImported(env, obj);
diff --git a/ui/android/java/src/org/chromium/ui/base/SelectFileDialog.java b/ui/android/java/src/org/chromium/ui/base/SelectFileDialog.java
--- a/ui/android/java/src/org/chromium/ui/base/SelectFileDialog.java
+++ b/ui/android/java/src/org/chromium/ui/base/SelectFileDialog.java
@@ -52,6 +52,7 @@ public class SelectFileDialog
private static final String IMAGE_TYPE = "image/";
private static final String VIDEO_TYPE = "video/";
private static final String AUDIO_TYPE = "audio/";
+ private static final String HTML_TYPE = "text/html";
private static final String ALL_IMAGE_TYPES = IMAGE_TYPE + "*";
private static final String ALL_VIDEO_TYPES = VIDEO_TYPE + "*";
private static final String ALL_AUDIO_TYPES = AUDIO_TYPE + "*";
@@ -159,7 +160,7 @@ public class SelectFileDialog
if (!window.hasPermission(Manifest.permission.READ_CONTACTS)) {
missingPermissions.add(Manifest.permission.READ_CONTACTS);
}
- } else if (shouldUsePhotoPicker()) {
+ } else if (shouldUsePhotoPicker() || shouldShowHtmlTypes()) {
if (!window.hasPermission(Manifest.permission.READ_EXTERNAL_STORAGE)) {
missingPermissions.add(Manifest.permission.READ_EXTERNAL_STORAGE);
}
@@ -324,9 +325,7 @@ public class SelectFileDialog
* 3.) There is a valid Android Activity associated with the file request.
*/
private boolean shouldUseContactsPicker() {
- if (mFileTypes.size() != 1) return false;
- if (!mFileTypes.get(0).equals("text/json+contacts")) return false;
- return UiUtils.shouldShowContactsPicker() && mWindowAndroid.getActivity().get() != null;
+ return false;
}
/**
@@ -347,6 +346,7 @@ public class SelectFileDialog
}
if (!mimeTypes.contains(mimeType)) mimeTypes.add(mimeType);
}
+ if (mimeTypes.size() == 0) return null;
return mimeTypes;
}
@@ -649,6 +649,10 @@ public class SelectFileDialog
return countAcceptTypesFor(specificType) > 0;
}
+ private boolean shouldShowHtmlTypes() {
+ return countAcceptTypesFor(HTML_TYPE) > 0;
+ }
+
private boolean shouldShowImageTypes() {
return shouldShowTypes(ALL_IMAGE_TYPES, IMAGE_TYPE);
}
--
2.11.0
@@ -31,7 +31,7 @@ diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
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
@@ -830,14 +830,14 @@ by a child template that "extends" this file.
@@ -829,14 +829,14 @@ by a child template that "extends" this file.
</provider>
<!-- Sync adapter for browser invalidation. -->
@@ -2,16 +2,17 @@ From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Wed, 21 Mar 2018 14:15:28 +0100
Subject: User Agent: anonymize
Use a fixed device name and Chrome product version.
Use a fixed device name and Chrome product version with the goal of not
disclosing the specific build of Bromite.
---
components/version_info/version_info.cc | 17 +++++++-
content/common/user_agent.cc | 73 +++++++++++++++++++++------------
2 files changed, 62 insertions(+), 28 deletions(-)
components/version_info/version_info.cc | 13 +++++-
content/common/user_agent.cc | 72 ++++++++++++++++++++-------------
2 files changed, 57 insertions(+), 28 deletions(-)
diff --git a/components/version_info/version_info.cc b/components/version_info/version_info.cc
--- a/components/version_info/version_info.cc
+++ b/components/version_info/version_info.cc
@@ -7,13 +7,28 @@
@@ -7,13 +7,24 @@
#include "base/logging.h"
#include "base/no_destructor.h"
#include "base/version.h"
@@ -28,16 +29,12 @@ diff --git a/components/version_info/version_info.cc b/components/version_info/v
+ &minor,
+ &bugfix);
+ switch (major) {
+ case 7:
+ return "Chrome/63.0.3239.111";
+ case 6:
+ return "Chrome/63.0.3239.83";
+ case 5:
+ case 4:
+ return "Chrome/62.0.3202.84";
+ return "Chrome/69.0.3497.100";
+ }
+ // version 8 and above
+ return "Chrome/67.0.3396.87";
+
+ // version 5 and above
+ return "Chrome/70.0.3538.80";
}
std::string GetProductName() {
@@ -56,7 +53,7 @@ diff --git a/content/common/user_agent.cc b/content/common/user_agent.cc
std::string GetWebKitVersion() {
return base::StringPrintf("%d.%d (%s)",
WEBKIT_VERSION_MAJOR,
@@ -66,7 +61,33 @@ std::string BuildOSCpuInfo(bool include_android_build_number) {
@@ -66,7 +61,32 @@ std::string BuildOSCpuInfo(bool include_android_build_number) {
}
#elif defined(OS_ANDROID)
std::string android_version_str = base::SysInfo::OperatingSystemVersion();
@@ -66,24 +63,23 @@ diff --git a/content/common/user_agent.cc b/content/common/user_agent.cc
+ // Send information about the device and build ID.
+ // Use a common device/build ID based on Android major version.
+ switch (os_major_version) {
+ default: // version 9 and above
+ android_info_str = "ONEPLUS A6000";
+ break;
+ case 8:
+ android_info_str = "FIG-LX3";
+ break;
+ case 7:
+ // Chrome/63.0.3239.111
+ android_info_str = "SM-J730GM Build/NRD90M";
+ android_info_str = "SM-G610M";
+ break;
+ case 6:
+ // Chrome/63.0.3239.83
+ android_info_str = "SM-G532G Build/MMB29T";
+ android_info_str = "SM-J700M";
+ break;
+ case 5:
+ // Chrome/62.0.3202.84
+ android_info_str = "A37fw Build/LMY47V";
+ android_info_str = "XT1033";
+ break;
+ case 4:
+ // Chrome/62.0.3202.84
+ android_info_str = "SM-G7102 Build/KOT49H";
+ break;
+ default: // version 8 and above
+ android_info_str = "SM-G950U Build/R16NW";
+ android_info_str = "ZTE Blade C370 Build/KOT49H";
+ break;
+ }
+
@@ -91,7 +87,7 @@ diff --git a/content/common/user_agent.cc b/content/common/user_agent.cc
#elif (defined(OS_POSIX) && !defined(OS_MACOSX)) || defined(OS_FUCHSIA)
// Should work on any Posix system.
struct utsname unixinfo;
@@ -102,7 +123,7 @@ std::string BuildOSCpuInfo(bool include_android_build_number) {
@@ -102,7 +122,7 @@ std::string BuildOSCpuInfo(bool include_android_build_number) {
os_minor_version,
os_bugfix_version
#elif defined(OS_ANDROID)
@@ -100,7 +96,7 @@ diff --git a/content/common/user_agent.cc b/content/common/user_agent.cc
android_version_str.c_str(),
android_info_str.c_str()
#elif defined(OS_POSIX) || defined(OS_FUCHSIA)
@@ -137,18 +158,6 @@ std::string BuildUserAgentFromProduct(const std::string& product) {
@@ -137,18 +157,6 @@ std::string BuildUserAgentFromProduct(const std::string& product) {
return BuildUserAgentFromOSAndProduct(os_info, product);
}
@@ -119,7 +115,7 @@ diff --git a/content/common/user_agent.cc b/content/common/user_agent.cc
std::string GetAndroidOSInfo(bool include_android_build_number) {
std::string android_info_str;
@@ -162,18 +171,28 @@ std::string GetAndroidOSInfo(bool include_android_build_number) {
@@ -162,18 +170,28 @@ std::string GetAndroidOSInfo(bool include_android_build_number) {
}
// Append the build ID.
@@ -51,7 +51,7 @@ diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
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
@@ -78,22 +78,17 @@ by a child template that "extends" this file.
@@ -77,22 +77,17 @@ by a child template that "extends" this file.
<permission android:name="{{ manifest_package }}.permission.CHILD_SERVICE" android:protectionLevel="signature" />
<permission android:name="{{ manifest_package }}.permission.READ_WRITE_BOOKMARK_FOLDERS" android:protectionLevel="signatureOrSystem" />
<permission android:name="{{ manifest_package }}.TOS_ACKED" android:protectionLevel="signatureOrSystem" />
@@ -74,7 +74,7 @@ diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/Andro
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
<uses-permission android:name="com.google.android.apps.now.CURRENT_ACCOUNT_ACCESS" />
@@ -912,43 +907,6 @@ by a child template that "extends" this file.
@@ -911,43 +906,6 @@ by a child template that "extends" this file.
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize"
android:hardwareAccelerated="false" />
@@ -118,7 +118,7 @@ diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/Andro
<!-- Notification service for sync. -->
<meta-data android:name="ipc.invalidation.ticl.listener_service_class"
android:value="org.chromium.chrome.browser.invalidation.ChromeInvalidationClientService"/>
@@ -960,8 +918,6 @@ by a child template that "extends" this file.
@@ -959,8 +917,6 @@ by a child template that "extends" this file.
</service>
<service android:name="com.google.ipc.invalidation.ticl.android2.TiclService"
android:exported="false"/>
@@ -127,7 +127,7 @@ diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/Andro
<receiver android:name="com.google.ipc.invalidation.ticl.android2.AndroidInternalScheduler$AlarmReceiver"
android:exported="false"/>
<receiver android:name="com.google.ipc.invalidation.external.client.contrib.AndroidListener$AlarmReceiver"
@@ -988,24 +944,6 @@ by a child template that "extends" this file.
@@ -987,24 +943,6 @@ by a child template that "extends" this file.
android:exported="false"
android:permission="android.permission.BIND_JOB_SERVICE"/>
@@ -477,7 +477,7 @@ diff --git a/chrome/android/java_sources.gni b/chrome/android/java_sources.gni
"java/src/org/chromium/chrome/browser/ChromeBackupAgent.java",
"java/src/org/chromium/chrome/browser/ChromeBackupWatcher.java",
"java/src/org/chromium/chrome/browser/ChromeFeatureList.java",
@@ -1345,7 +1344,6 @@ chrome_java_sources = [
@@ -1344,7 +1343,6 @@ chrome_java_sources = [
"java/src/org/chromium/chrome/browser/services/AndroidEduAndChildAccountHelper.java",
"java/src/org/chromium/chrome/browser/services/AndroidEduOwnerCheckCallback.java",
"java/src/org/chromium/chrome/browser/services/GoogleServicesManager.java",
@@ -12,7 +12,7 @@ Added some Bromite-specific further improvements
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -1268,8 +1268,6 @@ jumbo_split_static_library("browser") {
@@ -1270,8 +1270,6 @@ jumbo_split_static_library("browser") {
"profiles/profile_attributes_entry.h",
"profiles/profile_attributes_storage.cc",
"profiles/profile_attributes_storage.h",

Some files were not shown because too many files have changed in this diff Show More