Index: chrome/renderer/chrome_content_renderer_client.cc |
diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc |
index 31595060204c0f3718b0db713a8fd699b5e872e2..db5f17f311a1e8d308c40c7ba518935ad675660f 100644 |
--- a/chrome/renderer/chrome_content_renderer_client.cc |
+++ b/chrome/renderer/chrome_content_renderer_client.cc |
@@ -1014,6 +1014,22 @@ bool ChromeContentRendererClient::ShouldSuppressErrorPage( |
NetErrorHelper::Get(render_frame)->ShouldSuppressErrorPage(url)) { |
return true; |
} |
+ |
+#if defined(ENABLE_EXTENSIONS) |
+ // Suppress error pages for the webstore when it's loaded in a frame. This |
+ // mitigates confusion which could arise from the fact that error pages commit |
+ // with the same URL as the failed load. Since pieces of the browser sometimes |
+ // rely on the last-committed URL as a permission check of sorts, and the |
+ // webstore is a special flower, this can cause problems that we can avoid by |
+ // simply suppressing the error page (see https://crbug.com/622385, for |
+ // example). |
+ GURL webstore_url(extension_urls::GetWebstoreLaunchURL()); |
+ if (!render_frame->IsMainFrame() && url.SchemeIsHTTPOrHTTPS() && |
+ url.DomainIs(webstore_url.host().c_str())) { |
+ return true; |
+ } |
+#endif |
+ |
// Do not flash an error page if the Instant new tab page fails to load. |
return SearchBouncer::GetInstance()->IsNewTabPage(url); |
} |