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

Unified Diff: third_party/WebKit/Source/core/loader/FrameLoader.cpp

Issue 2689653003: PlzNavigate: Enforce 'form-action' CSP on the browser-side. (Closed)
Patch Set: Add TODO. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/loader/FrameLoader.cpp
diff --git a/third_party/WebKit/Source/core/loader/FrameLoader.cpp b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
index b0958995412bd27ebf3da25668dc1bb662229fd1..a018fbbdda79c518e6cc037c970e2f2abde1c330 100644
--- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
@@ -1662,6 +1662,16 @@ NavigationPolicy FrameLoader::shouldContinueForNavigationPolicy(
bool isFormSubmission = type == NavigationTypeFormSubmitted ||
type == NavigationTypeFormResubmitted;
if (isFormSubmission &&
+ // 'form-action' check in the frame that is navigating is disabled on the
+ // renderer side when PlzNavigate is enabled, but is enforced on the
+ // browser side instead.
+ // N.B. check in the frame that initiates the navigation stills occurs in
+ // blink and is not enforced on the browser-side.
+ // TODO(arthursonzogni) The 'form-action' check should be fully disabled
+ // in blink when browser side navigation is enabled, except when the form
+ // submission doesn't trigger a navigation(i.e. javascript urls). Please
+ // see https://crbug.com/701749
+ !browserSideNavigationEnabled &&
!m_frame->document()->contentSecurityPolicy()->allowFormAction(
request.url()))
return NavigationPolicyIgnore;

Powered by Google App Engine
This is Rietveld 408576698