Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Issue 2377833002: Block navigations in extensions via ShouldTransferNavigation (not via OpenURL). (Closed)

Created:
4 years, 2 months ago by Łukasz Anforowicz
Modified:
4 years, 2 months ago
Reviewers:
Charlie Reis, Devlin, sky
CC:
chromium-reviews, extensions-reviews_chromium.org, cbentzel+watch_chromium.org, creis+watch_chromium.org, tburkard+watch_chromium.org, nasko+codewatch_chromium.org, jam, gavinp+prer_chromium.org, darin-cc_chromium.org, chromium-apps-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Block navigations in extensions via ShouldTransferNavigation (not via OpenURL). (this is relanding a slightly tweaked r421287). 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 (tracked in https://crbug.com/650694) 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 #2 above (i.e. avoid OpenURL only for POST requests). BUG=646261 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation TBR=sky@chromium.org, rdevlin.cronin@chromium.org Committed: https://crrev.com/1d02573dbb13b5d7bd76f172afdf19a6389dc2f7 Cr-Commit-Position: refs/heads/master@{#421645}

Patch Set 1 : Original CL taken from the reverted https://crrev.com/2352083003/#ps220001 #

Patch Set 2 : Before continuing, wait until the popup is really closed. #

Patch Set 3 : Add missing files under chrome/test/data/extensions/api_test/browser_action/popup_with_form/ #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+310 lines, -16 lines) Patch
M chrome/browser/extensions/api/extension_action/browser_action_apitest.cc View 1 5 chunks +201 lines, -2 lines 0 comments Download
M chrome/browser/extensions/extension_view_host.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/extensions/extension_view_host.cc View 1 chunk +8 lines, -0 lines 0 comments Download
M chrome/browser/extensions/process_management_browsertest.cc View 2 chunks +54 lines, -0 lines 0 comments Download
M chrome/browser/prerender/prerender_contents.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/renderer/chrome_content_renderer_client.cc View 1 chunk +10 lines, -0 lines 0 comments Download
A + chrome/test/data/extensions/api_test/browser_action/popup_with_form/manifest.json View 2 1 chunk +2 lines, -2 lines 0 comments Download
A chrome/test/data/extensions/api_test/browser_action/popup_with_form/other_page.html View 2 1 chunk +6 lines, -0 lines 1 comment Download
A chrome/test/data/extensions/api_test/browser_action/popup_with_form/popup.html View 2 1 chunk +14 lines, -0 lines 1 comment Download
A + chrome/test/data/extensions/api_test/browser_action/popup_with_form/popup.js View 2 0 chunks +-1 lines, --1 lines 0 comments Download
M content/browser/cross_site_transfer_browsertest.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/frame_host/navigation_request.cc View 1 chunk +2 lines, -3 lines 0 comments Download
M content/browser/frame_host/navigator_delegate.h View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/frame_host/navigator_delegate.cc View 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/frame_host/navigator_impl.cc View 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/web_contents/web_contents_impl.h View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/web_contents/web_contents_impl.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M content/public/browser/web_contents_delegate.h View 1 chunk +1 line, -1 line 0 comments Download
M content/public/browser/web_contents_delegate.cc View 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 20 (13 generated)
Łukasz Anforowicz
Charlie, could you PTAL? This CL is basically the same as what you have already ...
4 years, 2 months ago (2016-09-28 21:00:57 UTC) #10
Łukasz Anforowicz
sky@ + rdevlin.cronin@, I hope it is okay to just add you to TBR - ...
4 years, 2 months ago (2016-09-28 21:07:59 UTC) #13
Charlie Reis
Yep, diff looks good. RS LGTM for the rest. Thanks for the test fix!
4 years, 2 months ago (2016-09-28 21:22:59 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2377833002/40001
4 years, 2 months ago (2016-09-28 21:29:49 UTC) #16
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 2 months ago (2016-09-28 21:36:29 UTC) #17
commit-bot: I haz the power
Patchset 3 (id:??) landed as https://crrev.com/1d02573dbb13b5d7bd76f172afdf19a6389dc2f7 Cr-Commit-Position: refs/heads/master@{#421645}
4 years, 2 months ago (2016-09-28 21:38:41 UTC) #19
Devlin
4 years, 2 months ago (2016-09-29 17:05:41 UTC) #20
Message was sent while issue was closed.
retroactive lgtm w/ tiny nits that can be fixed in a followup.

https://codereview.chromium.org/2377833002/diff/40001/chrome/test/data/extens...
File
chrome/test/data/extensions/api_test/browser_action/popup_with_form/other_page.html
(right):

https://codereview.chromium.org/2377833002/diff/40001/chrome/test/data/extens...
chrome/test/data/extensions/api_test/browser_action/popup_with_form/other_page.html:6:

nit: extra newline here

https://codereview.chromium.org/2377833002/diff/40001/chrome/test/data/extens...
File
chrome/test/data/extensions/api_test/browser_action/popup_with_form/popup.html
(right):

https://codereview.chromium.org/2377833002/diff/40001/chrome/test/data/extens...
chrome/test/data/extensions/api_test/browser_action/popup_with_form/popup.html:14:

and here

Powered by Google App Engine
This is Rietveld 408576698