Hard-code the list of plugins and mimetypes in navigator #29652
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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] #29559
Bug: 1164635
Change-Id: I7c52af5b918768d8b4c4a9faa409fb4e6b72ecc2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3017890
Commit-Queue: Mason Freed <masonf@chromium.org>
Auto-Submit: Mason Freed <masonf@chromium.org>
Reviewed-by: Joey Arhar <jarhar@chromium.org>
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#909443}