Chrome 51 inspectedWindow.eval devtools.network.onRequestFinished

55 views
Skip to first unread message

Colin Richardson

unread,
Jun 14, 2016, 5:18:27 AM6/14/16
to Google Chrome Developer Tools
Has something changed from Chrome 50 to Chrome 51 in terms of inspectedWindow.eval ?
A long time DevTool's Extension I've made has been working fine then all of a sudden, Chrome 51, started using 100% CPU things start locking up. Pools of tears all around.

The problem comes when I can't do any debugging on it since things have started to lock up.
A solution I've come to so is to put a blocking boolean in. And that seems to have sorted the problem

I have an event listener for chrome.devtools.network.onRequestFinished.addListener(_onRequestFinished_devtools);
that has the possibility of running a eval command chrome.devtools.inspectedWindow.eval("myExpression ? true : false;", _onEval_inspectedWindow);

I am not sure if you guys have changed how either devtools.network or inspectedWindow.eval work? Maybe something to do with asynchronous nature?

Either way, I just want to try and understand why it's changed all of a sudden.

- Colin.

PS: another thing I just thought but not tested is... Is the loading of chrome.devtools.panels.create("My Panel", "", "/html/myPanel.html"); counting as a network request? as that (if conditions were correct) could have sent my code into an infinite loop. But this never used to be the case.

Andrey Kosyakov

unread,
Jun 14, 2016, 7:46:02 AM6/14/16
to Google Chrome Developer Tools
On Tue, Jun 14, 2016 at 11:18 AM, Colin Richardson <worms...@gmail.com> wrote:
Has something changed from Chrome 50 to Chrome 51 in terms of inspectedWindow.eval ?
A long time DevTool's Extension I've made has been working fine then all of a sudden, Chrome 51, started using 100% CPU things start locking up. Pools of tears all around.

The problem comes when I can't do any debugging on it since things have started to lock up.
A solution I've come to so is to put a blocking boolean in. And that seems to have sorted the problem

I have an event listener for chrome.devtools.network.onRequestFinished.addListener(_onRequestFinished_devtools);
that has the possibility of running a eval command chrome.devtools.inspectedWindow.eval("myExpression ? true : false;", _onEval_inspectedWindow);

I am not sure if you guys have changed how either devtools.network or inspectedWindow.eval work? Maybe something to do with asynchronous nature?

Either way, I just want to try and understand why it's changed all of a sudden.

I don't think we've explicitly changed the semantics of any of these calls, but we can't entirely rule out any accidental regression that might creep in. Please file a bug on crbug.com, and it would certainly help to troubleshoot it if you could provide a reduction. Anyway, these are all async calls, so while you still can probably have an infinite loop, you're pretty unlikely to have some tight loop that would not be possible to break.
 
PS: another thing I just thought but not tested is... Is the loading of chrome.devtools.panels.create("My Panel", "", "/html/myPanel.html"); counting as a network request? as that (if conditions were correct) could have sent my code into an infinite loop. But this never used to be the case.

It would technically produce a network request since this basically loads an iframe, but since this will happen in the DevTools front-end and not in the inspected page, you're not expected to see it within the network requests available through chrome.devtools.network.

Best regards,
Andrey.
Reply all
Reply to author
Forward
0 new messages