New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

dvhb-badbrowser

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dvhb-badbrowser

The library checks user client and shows a warning if the browser version does not meet minimal requirements

  • 1.0.4
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Bad Browser

Install

bower install dvhb-badbrowser

Demo

http://dvhbru.github.io/dvhb-badbrowser/

Using

Put html for your alert windows in /alerts/ with this pattern:

alerts/
 ru.html
 ru.mobile.html
 en.html
 en.mobile.html
 ...
<script src="bower_components/dvhb-badbrowser/badbrowser.js"></script>

Call badbrowser.init

badbrowser.init({
    // path to your html alerts
    // could be a function:
    // function (ua) {
    //   return '/alerts/' + lang + '.html'
    // }
    path: '/alerts/en.html',
    // if `false` then user's choice will be saved in the cookies
    // and alert window will not be showen next time
    ignoreChoice: false,
    // Min version of browser that will be supported
    supported: {
        // user of chrome v.39 will see an alert winodw
        chrome: 42,
        firefox: 38,
        ie: 9,
        opera: 26,
        opera_mini: 7,
        safari_mobile: 7,
        android: 10,
        safari: 6,
        // if `false`, will show alert for any mobile browser
        mobile: false
    }
})

Instead of specifying supported property you can specify unsupported browsers:

badbrowser.init({
    unsupported: {
        // the same as supported.chrome = 40
        chrome: 39,
        // the same as supported.firefox = 34
        firefox: 33,
        // will show alert for any mobile browser
        mobile: true
    }
})

LICENSE

MIT License © dvhb

FAQs

Package last updated on 16 May 2016

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc