ember-cli-is-mobile-shim
v0.0.2
Published
Import isMobile.js into your Ember applications
Downloads
8
Maintainers
Readme
ember-cli-is-mobile-shim
An ES6 accessible module for isMobile.js within your Ember applications. Includes FastBoot support!
Usage
ember install ember-cli-is-mobile-shim
import isMobile from 'is-mobile';
In the browser, the isMobile object returns the computed user agent tests.
In FastBoot, the import returns the isMobile method since navigator is not available. You can fetch the FastBoot headers and run the method manually.
const headers = this.get('fastboot.request.headers');
const userAgent = headers.get('user-agent');
isMobile(userAgent);
License
ember-cli-is-mobile-shim is MIT Licensed.
Attribution
Technical implementation for FastBoot support based on ember-cli-moment-shim.