-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
File Handling: Reset allowed permission on manifest update (M91).
To ensure that: (1) A dPWA cannot request expanded access to file handlers without user consent, when file handlers (ContentSettingsType::FILE_HANDLING) are in the "ALLOW" state, update the permission during manifest update to reset this status back to "ASK". (2) A dPWA cannot register additional file handlers on the system when the user has BLOCK'ed the API, disallow file handlers to update during manifest update when the permission is set to "BLOCK". Before, file handler permissions weren't affected by manifest update. Notably, this also makes OS registered file handlers out of sync with registrar file handlers. This will be fixed with crbug.com/1194163 As File Handling OS integration isn't currently testable via automated tests, here's the manual test to verify that file handlers don't update when BLOCK'ed after this patch (verified on Linux): (1) Create a file with extension ".txt", and another file with extension ".docx". Verify that these files don't have in their "Open with" menu an option to open them using any not-yet-installed PWAs like https://morning-bubbly-chauffeur.glitch.me/ (2) Open and install a PWA with file handling support for ".txt" but not ".docx" extensions, like a fork of https://morning-bubbly-chauffeur.glitch.me/ (3) Use the "Open with" menu to open the ".txt" file created in (1) using the installed PWA from (2). Reject the permission to set the content setting for file handling to "BLOCK". (4) Modify the PWA manifest to also support the ".asdf" extension. (5) Close Chrome and reopen, triggering a manifest update. (6) Use the "Open with" menu to open the ".txt" file created in (1) using the installed PWA from (2). The permission prompt should not come up again, and the file should not load, signalling that the permission has stayed at "BLOCK". (7) Try to find the PWA from (2) using the "Open with" menu of the ".docx" file. The PWA should not appear in the "Open with" menu, because setting the content setting to "BLOCK" should have blocked manifest update of file handlers. (8) (Optional Teardown) Uninstall the PWA, and revert the manifest change so that only ".txt" is supported again. Similar tests may exist for verifying that manifests are still updated for permission ALLOW/ASK states. (cherry picked from commit dafa1fe) Bug: 1194309 Change-Id: I49f8a05d0d02767894ea04402c90f76ca6aa004e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2803471 Commit-Queue: Darwin Huang <huangdarwin@chromium.org> Reviewed-by: Daniel Murphy <dmurph@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#871133} Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2822473 Cr-Commit-Position: refs/branch-heads/4472@{#21} Cr-Branched-From: 3d60439-refs/heads/master@{#870763}
- Loading branch information
Darwin Huang
authored and
Chromium LUCI CQ
committed
Apr 12, 2021
1 parent
3244a57
commit 1b34f51
Showing
19 changed files
with
192 additions
and
34 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.