mirror of
https://github.com/electron/electron.git
synced 2026-01-27 00:09:09 -05:00
WebContents::InspectElement and WebContents::InspenctServiceWorker return immediately if DevTools is disabled
This commit is contained in:
@@ -1012,6 +1012,9 @@ void WebContents::InspectElement(int x, int y) {
|
||||
if (type_ == REMOTE)
|
||||
return;
|
||||
|
||||
if (disable_devtools_)
|
||||
return;
|
||||
|
||||
if (!managed_web_contents()->GetDevToolsWebContents())
|
||||
OpenDevTools(nullptr);
|
||||
scoped_refptr<content::DevToolsAgentHost> agent(
|
||||
@@ -1023,6 +1026,9 @@ void WebContents::InspectServiceWorker() {
|
||||
if (type_ == REMOTE)
|
||||
return;
|
||||
|
||||
if (disable_devtools_)
|
||||
return;
|
||||
|
||||
for (const auto& agent_host : content::DevToolsAgentHost::GetOrCreateAll()) {
|
||||
if (agent_host->GetType() ==
|
||||
content::DevToolsAgentHost::TYPE_SERVICE_WORKER) {
|
||||
|
||||
Reference in New Issue
Block a user