view parameters passed to JavaScript function in C

2019-02-18 00:38发布

I'm using Timeline in Chrome Developer Tools to help write a userscript. The timeline shows which functions are called, but not what values are actually passed to the parameters:

enter image description here

Is there a way to view the actual function that was run, including its values? I'm looking for any solution that will help me do this, even outside of Chrome.

1条回答
beautiful°
2楼-- · 2019-02-18 00:53

Open Sources tab at DevTools, select Snippets tab at left, right-click and select New, place text of function in middle window, return arguments from defined function, select text of function in middle window, right-click and select Add to Watch . At right window at Watch Expressions selected named function should be listed on left followed by how function is called, e.g., fn("abc", "def") followed by : Arguments[n] indicating and listing arguments passed to function where n is number of arguments passed; e.g., Arguments[2] for fn("abc", "def")

查看更多
登录 后发表回答