简体   繁体   中英

How to get inline function definitions back in Chrome's JavaScript console

Chrome's JavaScript console used to have a very helpful feature where if you entered the name of any function visible in the current scope it would print the complete definition of that function. Essentially as described in this answer here .

Some time ago (I think at least a couple of months, could be more) it stopped doing this, however, and entering a function name now gives a very unhelpful response, like:

在此处输入图片说明

I know I can click on that line (or right-click, and choose 'Show Function Definition') to be shown the function-definition in the 'Sources' tab, but that's very clunky compared to the previous inline function definitions (for a workflow that's typically along the lines of 'get the function definition, copy/paste into the console, change a few things, then overwrite the original function definition').

Another trick is to add a + "" after the function name (as in jobClicked + "" instead of jobClicked ), which shows the code in the console but loses all of the syntax highlighting.

Is there any way to get the JavaScript console to go back to its previous behavior of displaying the complete function definition inline inside of the JavaScript console, with the syntax-highlighting intact?

It's working in version 54. You can update your Chrome browser.

Example function table:

功能表示例

Chrome version:

Chrome版本

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM