Closed m-nathani closed 11 months ago
You can do this yourself:
const detectionOptions = {
order: navigator.cookieEnabled ? ['cookie', 'localStorage', 'navigator'] : ['localStorage', 'navigator'],
lookupCookie: 'i18next-widget',
lookupLocalStorage: 'i18nextLng-widget',
caches: navigator.cookieEnabled ? ['localStorage', 'cookie'] : ['localStorage'],
excludeCacheFor: ['cimode'],
};
fyi: similar discussion: https://github.com/js-cookie/js-cookie/issues/823#issuecomment-1543972888
fyi: similar discussion: js-cookie/js-cookie#823 (comment)
Way to go, for creating a robust api ! 😆
🐛 Bug Report
To Reproduce
A minimal reproducible example.
We found a report on sentry about failing to read cookies cookies on specific env mentioned below.
Expected behavior
Plugin for browser detection should have checks for reading cookies if they are enabled.
something similar to
navigator.cookieEnabled
: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/cookieEnabledP.S: will add these check in my code too.. however would be great to handle in detector itself to handle fallback.
Your Environment