Closed Bug 1818713 Opened 2 years ago Closed 2 years ago

Media elements video and audio no longer transferred via service worker

Categories

(Core :: DOM: Service Workers, defect)

Firefox 110
defect

Tracking

()

RESOLVED WONTFIX

People

(Reporter: gertjanal, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0

Steps to reproduce:

My server is hosting a video file at endpoint /datastream

<video src="https://server.com/datastream"></video>

A serviceworker is registered;

if ('serviceWorker' in navigator) {
    navigator.serviceWorker.register(`./service-worker.js`, {
        scope: './'
    });
}

The service worker intercepts all fetch requests and logs to console for debug

self.addEventListener('install', (event) => {
    event.waitUntil(self.skipWaiting());
});

self.addEventListener('activate', (event) => {
    event.waitUntil(self.clients.claim());
});

self.addEventListener('fetch', function(event) {
    console.log(`${event.request.destination}: ${event.request.url}`);
    event.respondWith(fetch(event.request));
});

Actual results:

Until recently, the video and audio elements were passed through this service worker. (In my case, adding additional request headers for security).

Now being in version 110, customers complained that the video element was no longer working. It seems that the request is no longer passed through the service worker. In Google Chrome, this behavior is still as expected.

Note: in the same webpage, I added a piece of js to fetch the same data url. That js request was intercepted by the service worker, so it doesn't seem to be a problem with the server.

Expected results:

I expect all document calls to pass through the service worker, as it used to do before.

Component: Untriaged → DOM: Service Workers
Product: Firefox → Core
Flags: needinfo?(echuang)

Probably a duplicate of bug 1803205.

(In reply to Tom S [:evilpie] from comment #1)

Probably a duplicate of bug 1803205.

Yes, it looks like it is the same issue

Adding crossorigin="use-credentials" to the <video> element fixed the problem

Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Resolution: --- → WONTFIX
Flags: needinfo?(echuang)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: