问题
I'm working on a Chrome extension and I would like to load the Google File picker. I have included the JS API script in my extension (I include it directly in the package).
When I try to load the picker:
google.setOnLoadCallback(function() {
var picker, view;
view = new google.picker.View(google.picker.ViewId.DOCS);
view.setMimeTypes("application/vnd.unishared.document");
picker = new google.picker.PickerBuilder().setAppId(...").addView(view).setCallback(function() {}).build();
return picker.setVisible(true);
});
google.load('picker', '1');
It redirects to a blank page, with no critical error logged in the console. Is it possible to load this API in this context?
来源:https://stackoverflow.com/questions/17161695/load-the-google-file-picker-in-a-chrome-extension