# Navigate to function from console

**URL:** <https://discourse.mozilla.org/t/navigate-to-function-from-console/19957>\
**Category:** Developer Tools\
**Created:** [October 4, 2017, 2:34am UTC](https://discourse.mozilla.org/t/navigate-to-function-from-console/19957 "2017-10-04T02:34:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![catrope](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/catrope/32/22902_2.png) [@catrope](https://discourse.mozilla.org/u/catrope)\
**Post date:** [October 4, 2017, 2:34am UTC](https://discourse.mozilla.org/t/navigate-to-function-from-console/19957/1 "2017-10-04T02:34:37Z")

</div>

In the Chrome dev tools, I often use the following workflow:

- Open console
- Access a function from its global symbol (e.g. `$.fn.offset` or `myObj.getFoo`)
- Console displays the first ~50 chars of the function body
- Click that
- I am now in the “Sources” (debugger) view, at that function

This is very useful when I’m trying to find a particular function that I know the global symbol of but that I don’t know how to find (is it `.prototype.offset =`, or `offset:`? or maybe it’s dynamic? what if there are multiple functions called `offset`?), or if I’m debugging and have an object and wonder “what code executes if I call `myObj.blahFunc()`?”.

Unfortunately, this doesn’t work in Firefox. I can type the name of a function in the console, and it’ll display as a Function object, but I haven’t found a way to get from there to the code of the function in the debugger view.

---

<div class="post-metadata">

**Author:** ![Nicolas\_Chevobbe](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/nicolas_chevobbe/32/28203_2.png) [@Nicolas\_Chevobbe](https://discourse.mozilla.org/u/Nicolas_Chevobbe)\
**Post date:** [October 4, 2017, 8:47am UTC](https://discourse.mozilla.org/t/navigate-to-function-from-console/19957/2 "2017-10-04T08:47:30Z")

</div>

Hello @catrope !  
The link to the debugger is tracked in [https://github.com/devtools-html/devtools-core/issues/640](https://github.com/devtools-html/devtools-core/issues/640). This should be doable with little plumbing work
