- From: Matt Falkenhagen <notifications@github.com>
- Date: Tue, 16 Jun 2015 01:53:06 -0700
- To: slightlyoff/ServiceWorker <ServiceWorker@noreply.github.com>
Received on Tuesday, 16 June 2015 08:53:33 UTC
@jakearchibald Thanks for the explanations. Just want to be sure Chrome is doing this right. I have a question about the same-origin, ``event.respondWith(fetch('url-that-redirects'))`` case. What happens in this case:
* SW a.js
```javascript
// controls scope '/A/'
onfetch = function(e) {
if (e.request.url.indexOf('redirect') != -1) {
e.respondWith(fetch('/http-302'));
}
}
```
* SW b.js
```javascript
// controls scope '/B/'
onfetch = function(e) {
e.respondWith(new Response('hello from SW B'));
}
```
* The server responds to ``/http-302`` with HTTP 302 to ``B/hello``
* Otherwise, if no SW intercepts a request, the server responds with ``hello from server``.
You navigate to ``A/redirect``. I get that the URL in the location bar would be ``A/redirect``, and the controller would be ``a.js``. Is the document content ``hello from SW B`` or ``hello from server``?
Current Chrome is from server.
---
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/706#issuecomment-112345454
Received on Tuesday, 16 June 2015 08:53:33 UTC