ember-cli-is-mobile-shim

0.0.2 • Public • Published

ember-cli-is-mobile-shim

npm Version Ember Observer Score Ember badge

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.

Package Sidebar

Install

npm i ember-cli-is-mobile-shim

Weekly Downloads

3

Version

0.0.2

License

MIT

Last publish

Collaborators

  • sandydoo