1.0.0 • Published 8 years ago

prerender-mobile-useragent v1.0.0

Weekly downloads
5
License
MIT
Repository
github
Last release
8 years ago

prerender-mobile-useragent npm version

Prerender plugin that enables you to create snapshots that prepared for mobile devices(iPhone, Android...).

How it works

Prerender creates snapshots with PhantomJS useragent (like the following) even if the original request is from mobiles.

PhantomJS/x.x.x ...

If you prepare pages, layouts or styles for mobiles depends on those useragent, you have to request with mobile useragent.

So this plugin adds 'iPhone'(default) to the Phantom's useragent when the original request is from mobile devices or bot.

PhantomJS/x.x.x ... iPhone

Requirement

  • Prerender >= 4.0.2

Usage

In your local prerender project run:

$ npm install prerender-mobile-useragent --save

Then in the server.js that initializes the prerender:

server.use(require('prerender-mobile-useragent'));

Using External Configuration

You can use the enviroment variable MOBILE_USER_AGENT

export MOBILE_USER_AGENT=mobile-useragent
# default is 'iPhone'
1.0.0

8 years ago

0.0.2

9 years ago

0.0.1

9 years ago