gpt4 book ai didi

google-chrome-extension - 重定向到 chrome 扩展页面现在变成了 chrome-extension ://invalid

转载 作者:行者123 更新时间:2023-12-02 01:07:13 26 4
gpt4 key购买 nike

我有一个正在构建的 chrome 扩展,它使用 OAuth 访问许多 API。我没有将我的消费者 secret 存储在扩展程序中,而是重定向到获取 token 的服务器,然后重定向回我的扩展程序中的页面。

直到最近,它都运行良好。现在,当重定向回扩展程序时,扩展程序页面将替换为 chrome-extension://invalid。

我现在缺少某些设置吗?

最佳答案

您必须通过将资源路径添加到 "web_accessible_resources" 来将扩展中的页面声明为“网络可访问” list 文件的一部分。最近,一个更新被推送到 Chrome 32,影响了扩展中页面重定向的行为。

您可以在 announcement on the chromium-extensions mailing list 中阅读有关此更改的更多信息:

Greetings Chrome extension developers!

If you’re using the web_accessible_resources feature in your extensions, then there’s some important news you need to know about.

We recently fixed a security issue in Chrome M32 where any request to a URL that was redirected by an extension to a local resource would succeed even if that local resource was not marked as web accessible.

Going forward, a navigation from a web origin to an extension resource will be blocked unless the resource is listed as web accessible. Note that, in particular, the navigation will be blocked when a page requests a public resource, but an extension redirects that request to a resource that is not web accessible. That is still true even if the extension owns the resource that is not web accessible.

If your extension accesses local resources, make sure that they are marked as web accessible. You can learn more about this here: http://developer.chrome.com/extensions/manifest/web_accessible_resources.html

For more information, please refer to this bug: (https://code.google.com/p/chromium/issues/detail?id=313155)

关于google-chrome-extension - 重定向到 chrome 扩展页面现在变成了 chrome-extension ://invalid,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21169241/

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