New issue
Advanced search Search tips

Issue 651658 link

Starred by 3 users

Issue metadata

Status: Assigned
Owner:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Feature



Sign in to add a comment

Enable caching of chrome-extension:// scheme in Cache Storage API

Project Member Reported by alchemist@google.com, Sep 30 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2874.0 Safari/537.36

Steps to reproduce the problem:
1. Try to execute the following code in a window console:
caches.open('some-cache').then(cache => cache.put(new Request('chrome-extension://some_id/some_war'), new Response('body')));

2. Notice console error:
Uncaught (in promise) TypeError: Request scheme 'chrome-extension' is unsupported at caches.open.then.cache

What is the expected behavior?
Feature request: Support caching chrome-extension:// in addition to http/https.

It is disallowed here as chrome-extension:// schemes fails protocolIsInHTTPFamily()
https://chromium.googlesource.com/chromium/blink/+/master/Source/modules/cachestorage/Cache.cpp#456
https://chromium.googlesource.com/chromium/blink/+/master/Source/modules/cachestorage/Cache.cpp#490

The use-case here is for a web app's Service Worker to cache Chrome extension WARs. More specifically, the Chrome extension is using a foreign fetch service worker to act as a simple content proxy for CORS and Mixed Content requests (requests to a WAR is intercepted by the FF SW, and the URL to proxy is extracted from a URL param on the incoming request and fetched on the behalf of the reqeuster (e.g. chrome-extension://id/proxy?url=https://www.google.com).

I would like to cache the request under the chrome-extension's scheme in the web app's SW. I could just cache it using a manufactured Request object with a non-existent http/https URL, but figured that there might be other legitimate use-cases for a SW caching WAR resources.

What went wrong?
Desired behavior is that chrome-extension:// is a cacheable scheme, along with HTTP/HTTPS.

Likely: component:Blink>Storage>CacheStorage

Did this work before? No 

Chrome version: 55.0.2874.0  Channel: n/a
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version: Shockwave Flash 23.0 r0
 
Components: Platform>Extensions>API
Labels: -Type-Bug Type-Feature
Status: Untriaged (was: Unconfirmed)
Looks like a Feature Request, based on the Expected Behavior.

Requesting someone from Dev team to look into this issue.

Thank you.
Project Member

Comment 2 by sheriffbot@chromium.org, Sep 30 2016

Labels: Hotlist-Google
Owner: lazyboy@chromium.org
Status: Assigned (was: Untriaged)
-> lazyboy for further triage

Sign in to add a comment