gpt4 book ai didi

google-chrome - chromiumapp.org 扩展重定向如何适用于 Google Chrome?

转载 作者:行者123 更新时间:2023-12-01 00:44:12 24 4
gpt4 key购买 nike

当您创建 Chrome 扩展程序并希望使用 OAuth 2.0 时,您可以使用 https://<app-id>.chromiumapp.org/* URL,因此能够让远程服务器直接访问您的浏览器实例(之前已回答 - 例如 https://stackoverflow.com/a/30613603/61239 )。有谁知道,或者能够推测这是如何工作的?您是否能够针对浏览器上的任何请求,或者这仅适用于 OAuth 2.0?

最佳答案

这由 WebAuthFlow class 处理。 ,其目的如下:

Given a provider URL, load the URL and perform usual web navigation until it results in redirection to a valid extension redirect URL. The provider can show any UI to the user if needed before redirecting to an appropriate URL.



当服务器指示浏览器重定向到一个有效的扩展重定向 URL 时,该 URL 被传递给提供给 chrome.identity.launchWebAuthFlow 的回调函数。 .

“适当”的 URL 被硬编码在 web_auth_flow.cc 中。 :
static const char kChromeExtensionSchemeUrlPattern[] =
"chrome-extension://%s/";
static const char kChromiumDomainRedirectUrlPattern[] =
"https://%s.chromiumapp.org/";

所以特殊网址 https://<app-id>.chromiumapp.org/*仅适用于 chrome.identity 的 WebAuthFlow 的上下文中API。请注意,该机制完全是 Chrome 内部的。从不请求 URL。

关于google-chrome - chromiumapp.org 扩展重定向如何适用于 Google Chrome?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35770897/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com