Skip to content

Latest commit

 

History

History
54 lines (39 loc) · 1.51 KB

README.md

File metadata and controls

54 lines (39 loc) · 1.51 KB

File-Size Version

detectOldBrowser.js

This is a plugin with small footprint that will help in determining if the browser is out dated or not. It also has a feature to configure the supported browser version for your application.

Steps

Include the js file into your page

<script src='https://cdn.jsdelivr.net/gh/akhilarjun/detectOldBrowser.js@v1.0/js/detectOldBrowser.min.js'></script>

And now use the boolean method to check if the browser you are using is outdated or not.

//Edited For Brewity
if(isBrowserOld()){
  // Notify the user that browser is old
}

You can also use the following method to get to know which browser are you using

var browser = get_browser();
console.log(browser.name,browser.version);

API

If your application supports older browsers upto a certain version number, you can configure it in the following way

minimum.IE = 9;

The supported browsers by the plugin is

minimum = {
    IE : 11,
    CHROME : 50,
    FIREFOX : 46,
    SAFARI : 5,
    OPERA : 37
}

A big thanks to the Stackoverflow Answer that helped in this plugin! 👍