Inspect JSON Objects on chrome.devtools.inspectedWindow

761 views
Skip to first unread message

Carlos Alberto Castaño García

unread,
Nov 29, 2013, 3:33:05 PM11/29/13
to google-chrome-...@googlegroups.com
Hi,

I trying build a Chrome Dev Tools extension for an app, i want to get the JSON Objects from that page loaded, i tried with "eval" function, but i get errors.

How can I inspect JSON Objects created on the pages inspected?

Thanks!.

Carlos Alberto Castaño García

unread,
Nov 29, 2013, 3:35:15 PM11/29/13
to google-chrome-...@googlegroups.com
The code i have using is:

chrome.devtools.inspectedWindow.eval(
"Object",
function(result, isException) {
if (isException)
{
alert("Error: "+isException.value);
}
else{
alert(JSON.stringify(result));
chrome.devtools.panels.create(
'Title',
null, // No icon path
'Panel/index.html',
null // no callback needed
);
}
     }
);

John J Barton

unread,
Dec 2, 2013, 3:12:01 PM12/2/13
to Google Chrome Developer Tools

What are "JSON Objects"? JSON is a format.


--
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/d97e09cc-43cc-4db9-90fa-1d98ae1b854a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

John J Barton

unread,
Dec 2, 2013, 3:14:51 PM12/2/13
to Google Chrome Developer Tools
Don't create a panel based on results from an eval call, you'll just be confused.  Create the panel then do the eval call. Or better: use the sidebar pane setExpression to put the result of eval directly into a Sidebar Pane:

jjb


--
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.
Message has been deleted

Carlos Alberto Castaño García

unread,
Dec 3, 2013, 7:43:31 AM12/3/13
to google-chrome-...@googlegroups.com
Thanks.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-developer-tools+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages