DescriptionBlock navigations in extensions via ShouldTransferNavigation (not via OpenURL).
Before this CL, blocking of top-level navigations in extension pop-ups
was accomplished by routing them via OpenURL path and blocking (or
rather - silently dropping) CURRENT_TAB navigations via
ExtensionViewHost::OpenURLFromTab. This was problematic for a few
reasons:
1. This unnecessarily blocked navigations that end-up being treated
as downloads (i.e. because HTTP response says Content-Disposition:
attachment). This was the root cause of the regression raised in
https://crbug.com/646261
2. There are still some remaining issues in handling of POST requests
via OpenURL path (e.g. dropping Content-Type header -
https://crbug.com/648648).
3. In the long-term we want to rely less on process isolation
accomplished via OpenURL - an exploited renderer process does not
necessarily have to go through OpenURL path and can instead choose
to use the regular, renderer-initiated path.
After this CL:
1. ExtensionViewHost::ShouldTransferNavigation is used to block top-level
navigations in extension pop-ups (and background pages).
2. POST navigations do not go through OpenURL path anymore (i.e. this CL
effectively reverts the essence of r407586).
In the long-term we want to make all extension navigations to not go
through OpenURL path, but this seems too risky to merge back to M54,
so for now we only do #1 above (i.e. avoid OpenURL only for POST
requests).
BUG=646261
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation
Committed: https://crrev.com/953f8c785a134b2b4bd9ff401ff27f7edef4172c
Cr-Commit-Position: refs/heads/master@{#421287}
Patch Set 1 : Testing what will fail when letting CURRENT_TAB to go through #Patch Set 2 : Browser tests for top-level navigations in pop-up extension #Patch Set 3 : Allowing CURRENT_TAB disposition to go through. #Patch Set 4 : Revert essence of r407586 + blocking ext->web via ShouldTransferNavigation. #Patch Set 5 : Added test for extension -> web navigation in a tab (which should succeed). #Patch Set 6 : Turns out that there is no downloads "shelf" on ChromeOS. #Patch Set 7 : Added a comment to ExtensionViewHost::ShouldTransferNavigation. #
Total comments: 10
Patch Set 8 : Addressed CR feedback from creis@. #
Total comments: 30
Patch Set 9 : Addressed CR feedback from rdevlin.cronin@. #Patch Set 10 : Going back to !defined(OS_CHROMEOS) as download shelf verification trigger. #
Total comments: 8
Patch Set 11 : Addressed more CR feedback from rdevlin.cronin@. #Patch Set 12 : Changed bug reference (in a TODO comment) to a fresh bug. #Messages
Total messages: 55 (40 generated)
|