-
Notifications
You must be signed in to change notification settings - Fork 883
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adapt Brave's implementation of navigator.plugins farbling
Due to the removal of flash, navigator.plugins will always report an empty array from now on, so Brave needs to adapt its farbling mechanism to work like this depending on the selected behavior: * "off": return the real navigators.plugins, that is, an empty array. * "balanced" or "maximum": return 2 randomly generated fake plugins. Additionally, we need to adapt the browser tests to account for this new scenario, and test that indeed the expectation of navigator.plugins returning an empty array stays true. Issues in Brave's GitHub related to the implementation of this feature: * Fingerprinting 2.0: Plugins brave/brave-browser#9435 * Fingerprinting 2.0: Plugins (word replacement) brave/brave-browser#10597 Chromium change: https://chromium.googlesource.com/chromium/src.git/+/f8fe422e0e8a026f73f9d74d26f75c3c93102030 commit f8fe422e0e8a026f73f9d74d26f75c3c93102030 Author: Mason Freed <masonfreed@chromium.org> Date: Wed Jan 20 18:50:56 2021 +0000 Empty out navigator.plugins and navigator.mimeTypes With this CL, navigator.plugins and navigator.mimeTypes will both return empty arrays. With the removal of Flash, there is no longer the need to return anything for navigator.plugins and navigator.mimeTypes. These APIs were used primarily for a) probing for Flash player support, or b) fingerprinting. As such, we'd like to return empty for these two properties. Gecko already switched to returning *only* Flash starting with Firefox 52, and returning empty as of Firefox 85. I2S: https://groups.google.com/a/chromium.org/g/blink-dev/c/bbxAGu90LgM Fixed: 1164635
- Loading branch information
Showing
5 changed files
with
47 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 0 additions & 17 deletions
17
chromium_src/third_party/blink/renderer/core/page/plugin_data.h
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 0 additions & 17 deletions
17
patches/third_party-blink-renderer-core-page-plugin_data.h.patch
This file was deleted.
Oops, something went wrong.
16 changes: 8 additions & 8 deletions
16
patches/third_party-blink-renderer-modules-plugins-dom_plugin_array.cc.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
diff --git a/third_party/blink/renderer/modules/plugins/dom_plugin_array.cc b/third_party/blink/renderer/modules/plugins/dom_plugin_array.cc | ||
index d75bf82ee420aa67fed211284da20934a6ace39a..c81fac42874465155847109cf629d4e28824ef0a 100644 | ||
index d75bf82ee420aa67fed211284da20934a6ace39a..f32822e36cbdd3ffea1d847df2c9effbfb394928 100644 | ||
--- a/third_party/blink/renderer/modules/plugins/dom_plugin_array.cc | ||
+++ b/third_party/blink/renderer/modules/plugins/dom_plugin_array.cc | ||
@@ -154,6 +154,7 @@ void DOMPluginArray::UpdatePluginData() { | ||
} | ||
} | ||
@@ -131,6 +131,7 @@ PluginData* DOMPluginArray::GetPluginData() const { | ||
void DOMPluginArray::UpdatePluginData() { | ||
if (base::FeatureList::IsEnabled(features::kNavigatorPluginsEmpty)) { | ||
dom_plugins_.clear(); | ||
+ BRAVE_DOM_PLUGINS_UPDATE_PLUGIN_DATA | ||
return; | ||
} | ||
+ BRAVE_DOM_PLUGINS_UPDATE_PLUGIN_DATA | ||
} | ||
|
||
void DOMPluginArray::ContextDestroyed() { | ||
PluginData* data = GetPluginData(); |