Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] Use a randomly-generated extension when creating a fake MimeCla…
…ssInfo MimeClassInfo now requires to pass a list of extensions to the constructor, so we need to generate at least a random one to create the fake MimeClassInfo used for farbling purposes. FIXME: 3 browser tests failing likely because of this patch being wrong: BraveNavigatorPluginsFarblingBrowserTest.FarbleNavigatorPlugins BraveNavigatorPluginsFarblingBrowserTest.FarbleNavigatorPluginsBuiltin BraveNavigatorPluginsFarblingBrowserTest.FarbleNavigatorPluginsReset Chromium change: https://source.chromium.org/chromium/chromium/src/+/fb96360c18b517bcc487c0de7235eec27e3adf5e commit fb96360c18b517bcc487c0de7235eec27e3adf5e Author: Mason Freed <[email protected]> Date: Fri Aug 6 20:20:17 2021 +0000 Hard-code the list of plugins and mimetypes in navigator See [1] for a previous attempt to completely empty the navigator.plugins and navigator.mimeTypes APIs. That caused site breakage due to sites scanning for a PDF reader. This new attempt is discussed in significant detail in [2], and involves the hard-coding of a list of PDF viewers and mime types. The plugins/mimetypes lists will be empty if the user setting to download PDFs instead of viewing them (chrome://settings/content/pdfDocuments) is enabled. This is to ensure compat with sites that scan the plugins list for specific PDF plugins to decide on behavior. Prior to this CL, when the PDF viewer is disabled, the PDF viewer plugins are unloaded. Tests were copied mostly verbatim from [3], thanks @domenic. I2S: https://groups.google.com/a/chromium.org/g/blink-dev/c/bbxAGu90LgM [1] https://chromium-review.googlesource.com/c/chromium/src/+/2783393 [2] whatwg/html#6738 [3] web-platform-tests/wpt#29559 Bug: 1164635
- Loading branch information