You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
603 B

  1. // On KaiOS, we may not be able to use a mouse cursor or navigate using Tab-based focus, so we install
  2. // special left/right focus navigation keyboard listeners, at least on public pages (i.e. so folks
  3. // can at least log in using KaiOS devices).
  4. function importArrowKeyNavigation() {
  5. return import(/* webpackChunkName: "arrow-key-navigation" */ 'arrow-key-navigation');
  6. }
  7. export default function loadKeyboardExtensions() {
  8. if (/KAIOS/.test(navigator.userAgent)) {
  9. return importArrowKeyNavigation().then(arrowKeyNav => {
  10. arrowKeyNav.register();
  11. });
  12. }
  13. return Promise.resolve();
  14. }