Google API access in devtool

42 views
Skip to first unread message

Stefan Maris

unread,
Dec 14, 2016, 7:22:55 AM12/14/16
to Google Chrome Developer Tools
Hi,

I'm wondering if it is possible to have a devtools extension make a connection to the Google API's, more particular one that needs an OAUTH2 connection?
Trying to develop an extension (devtools) which would gather some info from one of the users Google Apps (GTM in particular), to cross-reference some browser page content.

Stefan

PhistucK

unread,
Dec 14, 2016, 7:25:37 AM12/14/16
to Google Chrome Developer Tools
I do not think the extension page (the panel page) can use cross origin XMLHttpRequest or supports the host permissions, but you can route everything through the background page.
https://developers.google.com/api-client-library/javascript/features/authentication seems to indicate that OAuth2 can be used from JavaScript, so, I guess it is possible.


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-developer-tools+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-chrome-developer-tools/a71f5a52-736e-4d53-8e6b-84ca3a172756%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Stefan Maris

unread,
Dec 14, 2016, 9:46:47 AM12/14/16
to Google Chrome Developer Tools
Figured this out... created a chrome app API key, and used the chrome.identity service in the extension to obtain an OAUTH2 token.
Now I can directly call the API from a panel or from options page...

Kayce Basques

unread,
Dec 14, 2016, 6:06:41 PM12/14/16
to Google Chrome Developer Tools
Oh wow, that's pretty interesting. Thanks for sharing.

Please follow up with a link to your extension later, if you're making it public!
Reply all
Reply to author
Forward
0 new messages