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

Unified Diff: chrome/renderer/user_script_slave.cc

Issue 2799010: Revert 48693 - Only inject content scripts into HTML documents. Previously we... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 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
« 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/renderer/user_script_slave.cc
===================================================================
--- chrome/renderer/user_script_slave.cc (revision 50051)
+++ chrome/renderer/user_script_slave.cc (working copy)
@@ -18,8 +18,6 @@
#include "chrome/renderer/extension_groups.h"
#include "chrome/renderer/render_thread.h"
#include "googleurl/src/gurl.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebDocument.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebElement.h"
#include "third_party/WebKit/WebKit/chromium/public/WebFrame.h"
#include "grit/renderer_resources.h"
@@ -151,19 +149,6 @@
if (!URLPattern::IsValidScheme(frame_url.scheme()))
return true;
- // Only inject user scripts into documents with an <html> tag as the root
- // element. Note that WebCore fixes up html pages that lack a root HTML
- // element so that they include one. Also, documents like text/plain and
- // image/* are wrapped in a simple HTML document.
- //
- // Basically, this check filters out SVG documents and other types of XML
- // documents.
- if (frame->document().isNull() ||
- frame->document().documentElement().isNull() ||
- !frame->document().documentElement().hasTagName("html")) {
- return true;
- }
-
// Don't inject user scripts into the gallery itself. This prevents
// a user script from removing the "report abuse" link, for example.
if (frame_url.host() == GURL(extension_urls::kGalleryBrowsePrefix).host())
« 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