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.
source share