From cdfbe876a57f298cb1b2ce57cc41b942130ddf72 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 26 May 2016 19:29:39 +0900 Subject: [PATCH] Make sure chrome.devtools.inspectedWindow.tabId is set --- atom/browser/api/atom_api_web_contents.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index 72e87c30a8c7..df46eb883df8 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -655,6 +655,11 @@ void WebContents::DevToolsOpened() { isolate(), managed_web_contents()->GetDevToolsWebContents()); devtools_web_contents_.Reset(isolate(), handle.ToV8()); + // Set inspected tabID. + base::FundamentalValue tab_id(ID()); + managed_web_contents()->CallClientFunction( + "DevToolsAPI.setInspectedTabId", &tab_id, nullptr, nullptr); + // Inherit owner window in devtools. if (owner_window()) handle->SetOwnerWindow(managed_web_contents()->GetDevToolsWebContents(),