old-ios.js 442 B

123456789101112131415161718
  1. const userAgent = window.navigator.userAgent.toLowerCase();
  2. // TODO: impl more accurate logic
  3. // https://youtrack.weseek.co.jp/issue/GW-4826
  4. const isOldIos = /iphone os 12/.test(userAgent);
  5. /**
  6. * Apply 'oldIos' attribute to <html></html>
  7. */
  8. function applyOldIos() {
  9. if (isOldIos) {
  10. document.documentElement.setAttribute('old-ios', 'true');
  11. }
  12. }
  13. export {
  14. // eslint-disable-next-line import/prefer-default-export
  15. applyOldIos,
  16. };