在Chrome扩展中访问多个Gmail账户 [英] Get access to multiple gmail accounts in a chrome extension
问题描述
我正在创建一个修改Gmail邮件界面的Chrome扩展程序。
但是,当我在Chrome扩展程序中进行身份验证(使用chrome.identity.getAuthToken)时,它默认使用登录到Chrome的用户帐户。
但当我在该Gmail页面上时,我需要一个Gmail帐户的数据。
我看到 我只是经历了相同的过程,我找不到更简单的方法。 您需要验证自己。 我们尝试在该链接中使用该机制,但它需要将客户端秘密放入扩展中 - 非常丑陋。 最后,我们通过我们www网站的托管网页从外部请求和刷新令牌。 尽管设置一次就很麻烦,但它很好地工作,值得付出努力。 I'm creating a Chrome extension that modifies the gmail UI.
But when I authenticate (with chrome.identity.getAuthToken) in the Chrome extension, it defaults to using the user account that is signed into Chrome. But I need data for a gmail account when I am on that gmail page. I saw this answer, but I was wondering if there was any easier way? I just went through the same process and I couldn't find an easier way. You'll need to authenticate yourself. We tried using the mechanism in that link but it requires putting the Client Secret in the Extension - very ugly. In the end we request and refresh tokens externally through a hosted web page from our www site. Although a hassle to set up once in place it works nicely and is worth the effort. 这篇关于在Chrome扩展中访问多个Gmail账户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!