I know that the Google Drive API allows for drive integration with Chrome Apps, but what about extensions? Can/How do I use the Drive API in a chrome extension? For example I want an extension that will have a popup that list a user's docs, how do I get access to their drive box? I know it starts with authentication, but I'm not sure how to do that either.
Access your files from any deviceAfter your files sync, you can access them from any browser or device. Install any web browser. Go to drive.google.com.
Hi there, If you are in Google Drive and you're trying to open a Docs document, simply double-click on it. It should open in a new tab in Chrome. Some additional information (in case you are referring to Google Play/Android, which wasn't clear in your initial question):
Open Google Drive. Settings. Turn on Offline setting. If you are using Microsoft Edge, you will be redirected to the Chrome Web Store to download the Google Docs Offline extension.
Regarding authentication, chrome.identity is the place to start.
Taking a (not so) quick look at the GDrive App I didn't really spot any app-specific stuff (i.e. something not available to extensions). So, I would certainly start by trying to "port" the GDrive App to an extension.
There is, also, this tutorial I totally recommend about Building Apps with AngularJS, which actually walks you through building the GDrive App. It is super cool, has a fairly detailed explanation regarding how to set up authentication related stuff (of course, you'll have to slightly adapt that to apply to an extension) and you can just ignore the AngularJS-related stuff (if you are not interested - although AngularJS is super cool too).
Recommended road-map:
[Check out Zig Mandel's answer below for an interesting alternative.]
It's incredibly easy.
chrome.identity.getAuthToken() will handle the authorisation and return an access token. You then use that access token to set an http header when calling the Drive API.
There is some sample code here Chrome Manifest with Google API
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With