Skip to content

vmakhaev/oldbrowser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Old Browser

Ask users to upgrade old browser

alt tag

  • Connect Middleware
  • Old browsers are redirected to "Your browser is too old :(" page
  • Configurable
  • Inspired by Ruby-browser

Known Issues

  • No support for minor browser versions
  • All requests without user agent are just allowed

Installation

npm install oldbrowser

Sample

var oldbrowser = require('oldbrowser');

...
  // Connect middleware
  .use(oldbrowser())

Defaults are:

var supportedBrowsers = {
  'Chrome': 13,
  'Firefox': 4,
  'IE': 10,
  'Opera': 15,
  'Safari': 5
};

If you want to overwrite:

var options = {
  browsers: {
    'IE': 6 // It means that only IE >= 6 are allowed. All other browsers are denied
  }
};

...
  // Connect middleware
  .use(oldbrowser(options))

About

Connect middleware for restrict old browsers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published