Drive listener event listeners

I'm looking to create a Chrome extension that can (for example) connect to Google Drive, insert a DOM element somewhere (for example, the "Action Bar") and display some additional information when the user selects a file.

Presumably, Google Drive uses some event-driven user interface model, for example. "when the user clicks on the preview image for this file, downloads the" Activity "details for this file and displays them in the panel). However, it seems that none of them are documented anywhere (and, obviously, Google is cheating on its client Javascript).

Is there any public API for these events that I can connect to make callbacks? Sort of:

googleDriveUi.on("fileSelect", function(file) { alert("You have selected " + file.filename); }); 

I understand that I was able to achieve the same result by implementing my own user interface, and then connecting to the Google Drive API. I really do not want to do this if it can be avoided - the Google Drive user interface is already very good, so there is no need to reinvent the wheel.

An alternative would be to listen to web request events. For example, I see that when a file clicks on Drive, the request is made at http: // {google} /appsactivity/v1.1internal/activities? {Etcetc}. Perhaps the extension can listen to requests made at this URL, but maybe Google can change the specific endpoint of the request at any time, so this will be a pretty flaky solution.

Any other thoughts would be appreciated.

+6
source share
1 answer

There is no public API for front-end user interfaces. Some options:

a. The Google Apps Activity API is public and supported. You can get the changes formally by making requests there (assuming you sniffed the .id file on some client side, undocumented, flaky means).

B. “The right way” is to use the REST API integration interface “Open files” (“Open with”), but it depends on the user, the authorized / installed / connected application through OAuth.

C. Instead of writing a complete interface, you can simply use the Google Picker API . This will give you full control over the "user selected file.id = xyz".

Option B or C are the closest you can get using the fully and formally supported APIs.

If you want Google to add the functionality you need, you can view and / or record the function request for the Drive API .

+3
source

All Articles