Merge pull request #232 from atom/fix-devtools-menu
Fix crash when showing menu for devtools when there are multiple windows
This commit is contained in:
Коммит
9091a34675
|
@ -355,8 +355,8 @@ bool Window::IsCrashed() {
|
|||
}
|
||||
|
||||
mate::Dictionary Window::GetDevTools(v8::Isolate* isolate) {
|
||||
mate::Dictionary dict(mate::Dictionary::CreateEmpty(isolate));
|
||||
content::WebContents* web_contents = window_->GetDevToolsWebContents();
|
||||
mate::Dictionary dict(isolate);
|
||||
dict.Set("processId", web_contents->GetRenderProcessHost()->GetID());
|
||||
dict.Set("routingId", web_contents->GetRoutingID());
|
||||
return dict;
|
||||
|
|
|
@ -57,7 +57,7 @@ BrowserWindow.fromProcessIdAndRoutingId = (processId, routingId) ->
|
|||
|
||||
BrowserWindow.fromDevTools = (processId, routingId) ->
|
||||
windows = BrowserWindow.getAllWindows()
|
||||
for window in windows
|
||||
for window in windows when window.isDevToolsOpened()
|
||||
devtools = window.getDevTools()
|
||||
return window if devtools.processId == processId and
|
||||
devtools.routingId == routingId
|
||||
|
|
Загрузка…
Ссылка в новой задаче