0.0.1 • Published 8 years ago

prerender-vkshare-useragent v0.0.1

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

prerender-vkshare-useragent

Prerender plugin that enables you to create snapshots that prepared for vk.com.

How it works

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

PhantomJS/x.x.x ...

If you prepare pages, layouts or styles for mobiles depends on those useragent, you need to be requested with mobile useragent.

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

PhantomJS/x.x.x ... iPhone

How to use

In your local prerender project run:

$ npm install prerender-vkshare-useragent --save

Then in the server.js that initializes the prerender:

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

Using External Configuration

You can use the enviroment variable CUSTOM_USER_AGENT

export MOBILE_USER_AGENT=custom-user-agent
# default is 'vkShare'
1.0.0

8 years ago

0.0.1

8 years ago