diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index 77da81fdab9..508ccf9c31b 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -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 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) {