Closed
Bug 1201999
Opened 10 years ago
Closed 10 years ago
Image from different origin isn't loaded when using the event.respondWith() method
Categories
(Core :: DOM: Service Workers, defect)
Core
DOM: Service Workers
Tracking
()
RESOLVED
INCOMPLETE
Tracking | Status | |
---|---|---|
firefox43 | --- | affected |
People
(Reporter: marco, Unassigned)
Details
Attachments
(2 files)
The cache is empty, I'm not adding anything to the cache.
If I fetch the image without checking the cache first, the image is loaded correctly.
If I check the cache and then fetch the image, the image isn't loaded.
In both cases the promise returned by fetch is resolved (the console.log in the testcase I'm about to attach is called).
Reporter | ||
Comment 1•10 years ago
|
||
Reporter | ||
Comment 2•10 years ago
|
||
Reporter | ||
Comment 3•10 years ago
|
||
The attached page works correctly with the attached version of service-worker.js. If you uncomment the code I commented out, it doesn't work anymore.
Reporter | ||
Comment 4•10 years ago
|
||
If you right-click on the image and select "View Image Info", the image has the correct size in both cases (~40 kB) but wrong dimensions in the not-working case (0 × 0px instead of 300px × 450px).
Reporter | ||
Comment 5•10 years ago
|
||
(N.B.: When you uncomment the code you also need to remove a semicolon, otherwise the service worker will fail to load)
Summary: Image from different origin isn't loaded in some conditions → Image from different origin isn't loaded if fetched after checking the cache
Reporter | ||
Comment 6•10 years ago
|
||
The status code of the response is 200 for correctly loaded images, 0 for the others.
Reporter | ||
Comment 7•10 years ago
|
||
Here's an even simpler testcase.
This works:
self.addEventListener("fetch", function(event) {
return fetch(event.request);
});
This doesn't:
self.addEventListener("fetch", function(event) {
event.respondWith(fetch(event.request));
});
Summary: Image from different origin isn't loaded if fetched after checking the cache → Image from different origin isn't loaded when using the event.respondWith() method
Reporter | ||
Comment 8•10 years ago
|
||
So, basically the issue is that the non-normative section http://slightlyoff.github.io/ServiceWorker/spec/service_worker/#cross-origin-resources isn't being followed.
I'll file a new, clearer, bug.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → INCOMPLETE
You need to log in
before you can comment on or make changes to this bug.
Description
•