From 06324189b166bf588dc38379973636644bbf8b58 Mon Sep 17 00:00:00 2001 From: Mason Freed Date: Fri, 13 Aug 2021 14:24:48 +0000 Subject: [PATCH] Bug 1720376 [wpt PR 29652] - Hard-code the list of plugins and mimetypes in navigator, a=testonly Automatic update from web-platform-tests 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] https://github.com/whatwg/html/pull/6738 [3] https://github.com/web-platform-tests/wpt/pull/29559 Bug: 1164635 Change-Id: I7c52af5b918768d8b4c4a9faa409fb4e6b72ecc2 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3017890 Commit-Queue: Mason Freed Auto-Submit: Mason Freed Reviewed-by: Joey Arhar Reviewed-by: Chris Harrelson Cr-Commit-Position: refs/heads/master@{#909443} -- wpt-commits: 7be5ecfd72f0e95257f435a101b88e5ad277206f wpt-pr: 29652 --- .../plugins-and-mimetypes.html | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/plugins-and-mimetypes.html diff --git a/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/plugins-and-mimetypes.html b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/plugins-and-mimetypes.html new file mode 100644 index 0000000000000..af0501580121f --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/plugins-and-mimetypes.html @@ -0,0 +1,83 @@ + + +Navigator.plugins and navigator.mimeTypes behavior + + + + + + + \ No newline at end of file