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

Unified Diff: chrome/renderer/chrome_content_renderer_client.cc

Issue 2321503002: (Re-)introduce AncestorThrottle to handle 'X-Frame-Options'. (Closed)
Patch Set: Ugh. Created 4 years, 3 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: 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 79f1a1642037141c8d69d6b622b663d5873d66c9..2423bee362bc18655b11452e2a1238b3492d2013 100644
--- a/chrome/renderer/chrome_content_renderer_client.cc
+++ b/chrome/renderer/chrome_content_renderer_client.cc
@@ -1019,6 +1019,23 @@ 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
+
Mike West 2016/09/14 09:21:24 This is ugly. But without some ~large refactoring
alexmos 2016/09/14 20:25:10 Yeah, a bit unfortunate that we have to do this, b
Charlie Reis 2016/09/14 21:39:05 Hmm, I'm not ok with this change. This check isn'
alexmos 2016/09/17 01:43:16 Given Charlie's comments, and as a way to make pro
// Do not flash an error page if the Instant new tab page fails to load.
return SearchBouncer::GetInstance()->IsNewTabPage(url);
}
« no previous file with comments | « no previous file | components/error_page/common/localized_error.cc » ('j') | content/browser/frame_host/navigation_handle_impl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698