Load the Google File picker in a chrome extension

∥☆過路亽.° 提交于 2019-12-22 07:00:09

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!