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

Unified Diff: chrome/browser/ui/browser_commands.cc

Issue 304313003: Allow view-source of pages fully-blocked by Blink's XSS filter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_commands.cc
diff --git a/chrome/browser/ui/browser_commands.cc b/chrome/browser/ui/browser_commands.cc
index e2225bac044e306c1e8450572c8abddec57518b6..4891b18ee2dc70e67a5f7143c917bbc342a8d926 100644
--- a/chrome/browser/ui/browser_commands.cc
+++ b/chrome/browser/ui/browser_commands.cc
@@ -1144,6 +1144,14 @@ void ViewSource(Browser* browser, WebContents* contents) {
if (!entry)
return;
+ // If blink sent us to its blocked-page URL, show the source of the previous
+ // page (which generated the block) instead.
+ if (entry->GetURL() == GURL("data:,Blocked")) {
sky 2014/06/01 19:55:11 Is "data:,Blocked" not a legal url that could be e
+ entry = contents->GetController().GetEntryAtOffset(-1);
+ if (!entry)
+ return;
+ }
+
ViewSource(browser, contents, entry->GetURL(), entry->GetPageState());
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698