devtools: initialise devtoolsWebContents when opened with inspect* apis
This commit is contained in:
parent
ad851547e0
commit
67a9931b55
3 changed files with 10 additions and 4 deletions
|
@ -308,7 +308,6 @@ bool NativeWindow::IsDevToolsOpened() {
|
|||
}
|
||||
|
||||
void NativeWindow::InspectElement(int x, int y) {
|
||||
OpenDevTools(true);
|
||||
scoped_refptr<content::DevToolsAgentHost> agent(
|
||||
content::DevToolsAgentHost::GetOrCreateFor(GetWebContents()));
|
||||
agent->InspectElement(x, y);
|
||||
|
@ -318,7 +317,6 @@ void NativeWindow::InspectServiceWorker() {
|
|||
for (const auto& agent_host : content::DevToolsAgentHost::GetOrCreateAll()) {
|
||||
if (agent_host->GetType() ==
|
||||
content::DevToolsAgentHost::TYPE_SERVICE_WORKER) {
|
||||
OpenDevTools(true);
|
||||
inspectable_web_contents()->AttachTo(agent_host);
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue