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

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: Add xss_detected_ bool and use it. Created 6 years, 6 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/browser/ui/browser_commands.cc
diff --git a/chrome/browser/ui/browser_commands.cc b/chrome/browser/ui/browser_commands.cc
index 37da6f327e5dbc11213e05c12733f9415a7b088f..51d6964fb875968b7e2a8dfcad6c89c4c409b0df 100644
--- a/chrome/browser/ui/browser_commands.cc
+++ b/chrome/browser/ui/browser_commands.cc
@@ -1146,6 +1146,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
brettw 2014/06/18 21:51:41 Can this explain in more detail what happens when
Tom Sepez 2014/06/18 22:13:22 Done.
+ // page (which generated the block) instead.
+ if (entry->GetURL() == GURL("data:,")) {
+ NavigationEntry* previous = contents->GetController().GetEntryAtOffset(-1);
+ if (previous && previous->GetXssDetected())
+ entry = previous;
+ }
+
ViewSource(browser, contents, entry->GetURL(), entry->GetPageState());
}
« no previous file with comments | « no previous file | content/browser/frame_host/navigation_entry_impl.h » ('j') | content/browser/frame_host/navigation_entry_impl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698