How to get the browser language in a Serviceworker?

Asked

Viewed 15 times

0

How to get the browser language in a Serviceworker?

navigator.language || navigator.userLanguage; //não funciona
  • What it is returning in Navigator.language ?

  • Undefined. service worker is another context.

  • Yes, despite that I thought he had the language once I remembered that he has the useragent. Dude, I think it’s worth it for you to define a communication function with the front and make the sw cachear the answer.

  • Why you need this information in sw?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.