Dick Hardt
Dick Hardt

Reputation: 441

redirection to chrome extension page now turned into chrome-extension://invalid

I have a chrome extension I am building that accesses a number of APIs using OAuth. Rather than store my consumer secrets in the extension, I redirect to my server that acquires the tokens and then redirects back a page in my extension.

This was working fine until recently. Now when redirecting back to the extension the extension page gets replaced with chrome-extension://invalid.

Is there some setting I am missing now?

Upvotes: 3

Views: 2021

Answers (1)

Rob W
Rob W

Reputation: 348992

You must declare the page within your extension as "web accessible" by adding the path of the resource to the "web_accessible_resources" section of the manifest file. Recently, an updated was pushed to Chrome 32 that affects the behavior of redirects to pages within an extension.

You can read more about this change in the 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)

Upvotes: 7

Related Questions