summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-19 21:51:42 +0000
committerabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-19 21:51:42 +0000
commit2d9c6094d497fac4714ff79205de870c3b6ccaa1 (patch)
treea0d72229f875e4b9a31f6c80281596e528d8e749 /chrome
parentfb3bc70d9eb0de33d0bf9ccfa8e17f11c755e7d7 (diff)
downloadchromium_src-2d9c6094d497fac4714ff79205de870c3b6ccaa1.zip
chromium_src-2d9c6094d497fac4714ff79205de870c3b6ccaa1.tar.gz
chromium_src-2d9c6094d497fac4714ff79205de870c3b6ccaa1.tar.bz2
Do not run user scripts on chrome.google.com
BUG=28228 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32550 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/renderer/user_script_slave.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/chrome/renderer/user_script_slave.cc b/chrome/renderer/user_script_slave.cc
index c91e566..bdddbc3 100644
--- a/chrome/renderer/user_script_slave.cc
+++ b/chrome/renderer/user_script_slave.cc
@@ -11,6 +11,7 @@
#include "base/pickle.h"
#include "base/shared_memory.h"
#include "base/string_util.h"
+#include "chrome/common/extensions/extension.h"
#include "chrome/renderer/extension_groups.h"
#include "googleurl/src/gurl.h"
#include "third_party/WebKit/WebKit/chromium/public/WebFrame.h"
@@ -123,8 +124,14 @@ void UserScriptSlave::InsertInitExtensionCode(
bool UserScriptSlave::InjectScripts(WebFrame* frame,
UserScript::RunLocation location) {
+ GURL frame_url = GURL(frame->url());
// Don't bother if this is not a URL we inject script into.
- if (!URLPattern::IsValidScheme(GURL(frame->url()).scheme()))
+ if (!URLPattern::IsValidScheme(frame_url.scheme()))
+ 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::kGalleryBrowseUrl).host())
return true;
PerfTimer timer;