Google Drive frontend UI event listeners
I'm looking at creating a Chrome extension that could (for example) hook into Google Drive, insert a DOM element somewhere (eg the "Activity Pane"), and display some additional information when a user selects a file.
Presumably Google Drive uses some kind of event-driven UI model - eg "when user clicks the preview image for this file, load the "Activity" details for that file and display them in the pane). However, it looks like none of this is documented anywhere (and obviously Google obfuscates its client-side Javascript).
Is there some kind of public API for these events that I can hook into to execute callbacks? Something like:
googleDriveUi.on("fileSelect", function(file) {
alert("You have selected " + file.filename);
});
There's no public API to the front end UI events. Some options:
A. The Google Apps Activity API is public and supported. You could get changes formally by making requests there (assuming you had sniffed a file.id by some client-side, undocumented, flaky means).
B. The "right way" is to use the Drive REST API Open Files ("Open with") integration interface but this is dependent on the user having authorised/installed/connected an app via OAuth.
C. Instead of writing an entire front end UI you could just use the Google Picker API. This will give you full control of "the user has selected file.id=xyz".
Option B or C are the closest you can get with full and formally supported APIs.
If you would like Google to add the functionality you need, you can review and/or file a feature request for the Drive API.
链接地址: http://www.djcxy.com/p/89860.html上一篇: 如何使用Reflection API在TypeScript中获取数组项目类型?
下一篇: Google云端硬盘前端界面事件侦听器