How to search in object properties for a value during debugging?

10,375 views
Skip to first unread message

Tony Henrich

unread,
Jun 14, 2015, 4:19:10 AM6/14/15
to google-chrome-...@googlegroups.com
I know one of the properties of a very large object has a value. How do I determine which property contains this value? Looking for a way to search across all the properties for a value during debugging?

PhistucK

unread,
Jun 14, 2015, 10:57:58 AM6/14/15
to Google Chrome Developer Tools
If you type the name of the variable that has this object in the console panel and expand the output, I think you can use Control + F to search the console.


PhistucK

On Sun, Jun 14, 2015 at 11:19 AM, Tony Henrich <thenri...@gmail.com> wrote:
I know one of the properties of a very large object has a value. How do I determine which property contains this value? Looking for a way to search across all the properties for a value during debugging?

--
You received this message because you are subscribed to the Google Groups "Google Chrome Developer Tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-develo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-chrome-developer-tools/b3b010bd-0e22-408b-99e2-b65d2d67f7ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tony Henrich

unread,
Jun 14, 2015, 11:20:13 PM6/14/15
to google-chrome-...@googlegroups.com

I am looking for the name of the variable which has the value. I don't know which variable. 

PhistucK

unread,
Jun 15, 2015, 1:47:36 AM6/15/15
to Google Chrome Developer Tools
You wrote that you need to find the name of the property, not the name of the variable. So what is it exactly that you need?
Can you give an example? A screenshot? Something that would be clearer and accurate?


PhistucK

--
You received this message because you are subscribed to the Google Groups "Google Chrome Developer Tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-develo...@googlegroups.com.

Tony Henrich

unread,
Jun 15, 2015, 12:47:59 PM6/15/15
to google-chrome-...@googlegroups.com
Property. I didn't think it made a difference if I am trying to look for who is holding the value, an object property or a variable.

Example: I know an object is holding a value of 'Cadillac', a string value. I want to know what property has that value. After the search, the search would return the property name 'CarMake'.

It might seem that DevTools might not have such a built-in functionality. The JS search code I found on the web is not finding the property. I tested in a known property/value and it didn't return anything.

This Stackoverflow question is similar:

PhistucK

unread,
Jun 15, 2015, 1:21:06 PM6/15/15
to Google Chrome Developer Tools
Then my suggestion should give you the property as long as it is one level deep, if you need to find a several level deep property, then you can try stringifying the object (JSON.stringify(object)) and search the result.
Recursively walking through the global variables and so should also succeed, yes.

If this is not working for you, then you should present a specific case where this is not working and ask about it on stackoverflow.com, as this is not really a Developer Tools question, but a general inquiry for search for a property by its value.


PhistucK

--
You received this message because you are subscribed to the Google Groups "Google Chrome Developer Tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-develo...@googlegroups.com.

Tony Henrich

unread,
Jun 15, 2015, 1:41:19 PM6/15/15
to google-chrome-...@googlegroups.com
Thanks. 

I asked here because it's a tool search functionality question. Just a bit more specific where it is a search inside the debugger.  In Visual Studio I can do something similar so maybe a tool like Devtools has it also. That's all.
Reply all
Reply to author
Forward
0 new messages