It is better to run this example in a incognito window (because of the service worker).

Issue only with the serviceWorker in Chrome

Result:

Code executed on the window

var url = 'https://httpbin.org/redirect-to?url=https://httpbin.org/get';
var xhr = new XMLHttpRequest();
xhr.open('GET', url);
xhr.addEventListener('load', () => {
document.getElementById('result').textContent = xhr.responseURL;
});
xhr.send();

Possible explanation

It seems that `event.respondWith()` ignores the URL for requests if they are resolved through a redirect (status 30*)