I am writing a Chrome application and I want to use the Google Drive API so that my users can read / write files to their Google Drive.
I found information that the only way to get through OAuth streams from a Chrome app is to use web browsing (see this previous question of the Google Drive’s StackOverflow API in Chrome Packaged app ).
This restriction makes sense to me, because to go through the OAuth stream, you need to download external content, and keeping this Chrome app isolated from privileged code is important from a security point of view.
But once you have the OAuth access token, it looks like JavaScript from a Chrome application should be able to directly access the Google Drive API. This is not loading any content (for example, HTML or JS) into the browser, but simply calling the remote API to read / write data.
But it seems that the only supported way to use the JavaScript JavaScript API is to download it remotely using the following code:
<script src="https://apis.google.com/js/client.js"></script>
This will not work because the Chrome app cannot download remote content.
And my idea is to just download this client.jsand delete it in my local Chrome App directory does not work, because it client.jsseems to suggest that it can continue to load / execute more JavaScript as needed.
, , , , API JavaScript JavaScript , . ? , API - - , .
? / API -?: (