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

Unified Diff: chrome/renderer/extensions/renderer_permissions_policy_delegate.cc

Issue 2978953002: [Extensions] Don't allow content scripts on the New Tab Page (Closed)
Patch Set: Remove logging! Created 3 years, 5 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/extensions/renderer_permissions_policy_delegate.cc
diff --git a/chrome/renderer/extensions/renderer_permissions_policy_delegate.cc b/chrome/renderer/extensions/renderer_permissions_policy_delegate.cc
index 240da309a09dee582fcc36d48edc01624c0e6677..e7042d33b2228d0bc2cbfa311b1fcd5a6a15469b 100644
--- a/chrome/renderer/extensions/renderer_permissions_policy_delegate.cc
+++ b/chrome/renderer/extensions/renderer_permissions_policy_delegate.cc
@@ -5,6 +5,7 @@
#include "chrome/renderer/extensions/renderer_permissions_policy_delegate.h"
#include "chrome/common/extensions/extension_constants.h"
+#include "chrome/renderer/searchbox/search_bouncer.h"
#include "extensions/common/constants.h"
#include "extensions/common/extensions_client.h"
#include "extensions/common/manifest_constants.h"
@@ -37,6 +38,12 @@ bool RendererPermissionsPolicyDelegate::CanExecuteScriptOnPage(
return false;
}
+ if (SearchBouncer::GetInstance()->IsNewTabPage(document_url)) {
+ if (error)
+ *error = errors::kCannotScriptNtp;
+ return false;
+ }
+
return true;
}

Powered by Google App Engine
This is Rietveld 408576698