Socket
Socket
Sign inDemoInstall

prerender-vkshare-useragent

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    prerender-vkshare-useragent

Prerender plugin that enables you to create snapshots that prepared for vkShare crawlers


Version published
Weekly downloads
0
Maintainers
1
Install size
5.69 kB
Created
Weekly downloads
 

Readme

Source

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'

Keywords

FAQs

Last updated on 31 May 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc