code: function() {
        let ua = window.navigator.userAgent.toLowerCase();
        if (ua.indexOf("firefox") !== -1) {
          return "firefox";
        } else if (!!ua.match(/msie|trident\/7|edge/)) {
          return "ie";
        } else if (
          !!ua.match(/ipad|iphone|ipod/) &&
          ua.indexOf("windows phone") === -1
        ) {
          // Windows Phone flags itself as "like iPhone", thus the extra check
          return "ios";
        } else {
          return "other";
        }
      }
docs: browser sniffing sucks, but there are browser-specific quirks to handle that are not a matter of feature detection