Index: chrome/browser/extensions/api/debugger/debugger_api.cc |
diff --git a/chrome/browser/extensions/api/debugger/debugger_api.cc b/chrome/browser/extensions/api/debugger/debugger_api.cc |
index f927fcb3545f25721ea8c71a591f9a133f7161e7..c2f701feac15fe016dd221b395dc5a8e176d3681 100644 |
--- a/chrome/browser/extensions/api/debugger/debugger_api.cc |
+++ b/chrome/browser/extensions/api/debugger/debugger_api.cc |
@@ -529,6 +529,15 @@ bool DebuggerFunction::InitAgentHost() { |
} |
} else if (debuggee_.target_id) { |
agent_host_ = DevToolsAgentHost::GetForId(*debuggee_.target_id); |
+ if (agent_host_.get()) { |
+ if (PermissionsData::IsRestrictedUrl(agent_host_->GetURL(), |
+ agent_host_->GetURL(), |
+ extension(), |
+ &error_)) { |
+ agent_host_ = nullptr; |
+ return false; |
+ } |
+ } |
} else { |
error_ = keys::kInvalidTargetError; |
return false; |