Chrome扩展程序 - Google API的起源 [英] Chrome Extension - Javascript Origins for Google API

查看:127
本文介绍了Chrome扩展程序 - Google API的起源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将我的Chrome扩展程序上传文件上传到Google云端硬盘,但是我被禁止进行授权。我一直在处理此处的代码和说明,但我不知道在开发者控制台中为授权JavaScript起源设置了什么。



当我尝试授权时,原点是chrome-extension:// [extension id],但这不允许作为控制台中的授权原点。



我可以使用什么来源?

解决方案

不得不担心Chrome扩展程序中的原始部分,您只需生成特定于Chrome扩展程序的客户端ID,然后使用 Chrome身份验证API 以获取用户的授权。

I'm trying to make my Chrome extension upload files to Google Drive, but I'm stuck on authorization. I've been working off the code and instructions from here, but I don't know what to set for the "Authorized JavaScript Origins" in the developer console.

When I attempt to authorize, the origin is "chrome-extension://[extension id]", but this is not allowed as an authorized origin in the console.

What origin can I use?

解决方案

You don't have to worry about the origin part in Chrome Extension, you simply need to generate a client id specific to the Chrome Extension, and use the Chrome Identity API to get authorization from the user.

这篇关于Chrome扩展程序 - Google API的起源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆