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

Unified Diff: extensions/renderer/programmatic_script_injector.cc

Issue 1658913002: Make extensions use a correct same-origin check. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to comments. Created 4 years, 11 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: extensions/renderer/programmatic_script_injector.cc
diff --git a/extensions/renderer/programmatic_script_injector.cc b/extensions/renderer/programmatic_script_injector.cc
index f576305a7fa8c604c090a9d7623cfd95a7e09482..13f0a20a7e95c2fbb9f087c9a7d534354fa99f47 100644
--- a/extensions/renderer/programmatic_script_injector.cc
+++ b/extensions/renderer/programmatic_script_injector.cc
@@ -20,6 +20,7 @@
#include "third_party/WebKit/public/web/WebDocument.h"
#include "third_party/WebKit/public/web/WebLocalFrame.h"
#include "third_party/WebKit/public/web/WebScriptSource.h"
+#include "url/origin.h"
namespace extensions {
@@ -132,7 +133,7 @@ void ProgrammaticScriptInjector::OnWillNotInject(
if (url_.SchemeIs(url::kAboutScheme)) {
error = ErrorUtils::FormatErrorMessage(
manifest_errors::kCannotAccessAboutUrl, url_.spec(),
- effective_url_.GetOrigin().spec());
+ url::Origin(effective_url_).Serialize());
} else {
// TODO(?) It would be nice to show kCannotAccessPageWithUrl here if
// this is triggered by an extension with tabs permission. See

Powered by Google App Engine
This is Rietveld 408576698