Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firefox and CORS on manifest Redirect (302) #1498

Closed
mjaddani opened this issue Jul 18, 2018 · 14 comments
Closed

Firefox and CORS on manifest Redirect (302) #1498

mjaddani opened this issue Jul 18, 2018 · 14 comments
Labels
status: archived Archived and locked; will not be updated type: external An issue with an external dependency; not our issue; sometimes kept open for tracking

Comments

@mjaddani
Copy link

Have you read the FAQ and checked for duplicate open issues?: Yes

What version of Shaka Player are you using?: 2.4.2

Can you reproduce the issue with our latest release version?: Yes

Can you reproduce the issue with the latest code from master?: Yes

Are you using the demo app or your own custom app?:Both

If custom app, can you reproduce the issue using our demo app?: Yes

What browser and OS are you using?:
Firefox 61 on Windows 10

What are the manifest and license server URIs?: see email

What did you do?
We have a service router who redirect all manifest request to the correct origine server.
This redirect (302) works fine on Chrome but on Firefox we have this error

Blocage d’une requête multiorigines (Cross-Origin Request) : la politique « Same Origin » ne permet pas de consulter la ressource distante située sur xxxxxxxxxxxxxxxx. Raison : échec de la requête CORS.
Impossible de charger « xxxxxxxxxxxxxxxxxx ». Un service worker a communiqué un objet « promise » à FetchEvent.respondWith() qui a été rejeté avec la raison « TypeError: NetworkError when attempting to fetch resource. ».

Do you have any idee to resolve this ?

What did you expect to happen?
We want to have the same think like Chrome.

What actually happened?

@chrisfillmore
Copy link
Contributor

Is this the same as #1476 ?

@mjaddani
Copy link
Author

mjaddani commented Jul 20, 2018 via email

@joeyparrish
Copy link
Member

Not yet. We have not been able to reproduce #1476 yet. I will try with the content you emailed us. Perhaps if we can reproduce using your content, we can solve and close both issues.

@mjaddani
Copy link
Author

mjaddani commented Jul 20, 2018 via email

@joeyparrish
Copy link
Member

I can reproduce in Firefox 61.0.1, 62.0b10, and 63.0a1.

The error logs from Firefox complain about our ServiceWorker, which is interesting. It could be a bug in service_worker.js, or a bug in Firefox's ServiceWorker implementation, or maybe something in Firefox we can work around in our ServiceWorker.

I will dig a little deeper.

@mjaddani
Copy link
Author

I'have the same issue with IE11.

@joeyparrish
Copy link
Member

I haven't been able to figure this out yet. In the mean time, I recommend that you not use a ServiceWorker in your application. Our demo uses one, but if you aren't using ServiceWorker, you should not run into this bug.

@mjaddani
Copy link
Author

mjaddani commented Jul 26, 2018 via email

@joeyparrish
Copy link
Member

That depends on what your application looks like. Are you using our demo service worker in your app verbatim?

In the Shaka Player demo app, we have this snippet that registers the service worker:

https://github.com/google/shaka-player/blob/fa4954452663ae6d392b3a779e8b263d4dcd9aee/demo/main.js#L160

You would comment out the equivalent bit of code in your own app and then clear whatever service worker may already be installed by your browser. In Chrome, you do this in the "Application" tab of the JS console. In Firefox, I'm not sure where that happens.

If that is an effective workaround for you, then I recommend you do that for now until we can find the cause and provide a fix.

@joeyparrish joeyparrish added type: bug Something isn't working correctly and removed needs triage labels Jul 26, 2018
@shaka-bot shaka-bot added this to the v2.5 milestone Jul 26, 2018
@mjaddani
Copy link
Author

mjaddani commented Aug 1, 2018

We have found a solution, it's to use the params on the manifest. If we don't do a redirect but we rewrite the manifest with a good params, it's work on every Browser Firefox, Chrome, Edge, IE11.

@joeyparrish
Copy link
Member

Investigation into #1392 revealed that we are handling requests in our service worker that could be ignored instead. This may have some bearing on this issue as well.

@mjaddani
Copy link
Author

mjaddani commented Aug 30, 2018

Now, we rewrite manifest params <Location> on the mpd and it's works for all browser.

@joeyparrish
Copy link
Member

Now that I've dug a bit deeper, avoiding fetch handling in our service worker doesn't solve your problem. Nor does removing the service worker completely. I still get CORS errors in Firefox for your content. So I suspect the problem is between Firefox and your server, and has nothing to do with Shaka.

Since you have a workaround anyway, may I close this issue?

@joeyparrish joeyparrish added type: external An issue with an external dependency; not our issue; sometimes kept open for tracking and removed type: bug Something isn't working correctly labels Aug 30, 2018
@joeyparrish joeyparrish removed this from the v2.5 milestone Aug 30, 2018
@joeyparrish joeyparrish added the status: waiting on response Waiting on a response from the reporter(s) of the issue label Aug 30, 2018
@shaka-bot
Copy link
Collaborator

Closing due to inactivity. If this is still an issue for you or if you have further questions, you can ask us to reopen or have the bot reopen it by including @shaka-bot reopen in a comment.

@shaka-bot shaka-bot removed the status: waiting on response Waiting on a response from the reporter(s) of the issue label Sep 6, 2018
@shaka-project shaka-project locked and limited conversation to collaborators Nov 5, 2018
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Apr 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated type: external An issue with an external dependency; not our issue; sometimes kept open for tracking
Projects
None yet
Development

No branches or pull requests

4 participants