Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hard-code the list of plugins and mimetypes in navigator #29652

Merged
merged 1 commit into from Aug 6, 2021

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Jul 13, 2021

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}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Chromium project.

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}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants