Index: android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc |
diff --git a/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc b/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc |
index b24eb2b56eac50e61bccdadb308a07a74515d6c0..328cecf30f5e2d69e86b84336118844603d64e20 100644 |
--- a/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc |
+++ b/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc |
@@ -130,7 +130,22 @@ void AwResourceDispatcherHostDelegate::RequestBeginning( |
throttles->push_back(new MaybeCancelResourceThrottle( |
child_id, route_id, request)); |
- if (resource_type == ResourceType::MAIN_FRAME) { |
+ bool allow_intercepting = |
+ // We ignore POST requests because of BUG=155250. |
+ request->method() != "POST" && |
+ // We allow intercepting navigations within subframes, but only if the |
+ // scheme other than http or https. This is because the embedder |
+ // can't distinguish main frame and subframe callbacks (which could lead |
+ // to broken content if the embedder decides to not ignore the main frame |
+ // navigation, but ignores the subframe navigation). |
+ // The reason this is supported at all is that certain JavaScript-based |
+ // frameworks use iframe navigation as a form of communication with the |
+ // embedder. |
+ (resource_type == ResourceType::MAIN_FRAME || |
+ (resource_type == ResourceType::SUB_FRAME && |
+ !request->url().SchemeIs(chrome::kHttpScheme) && |
+ !request->url().SchemeIs(chrome::kHttpsScheme))); |
+ if (allow_intercepting) { |
throttles->push_back(InterceptNavigationDelegate::CreateThrottleFor( |
request)); |
} |