https://github.com/aristocr2t/obh
Outdated-Browser Handler
https://github.com/aristocr2t/obh
browser handler javascript outdated
Last synced: 10 months ago
JSON representation
Outdated-Browser Handler
- Host: GitHub
- URL: https://github.com/aristocr2t/obh
- Owner: aristocr2t
- License: mit
- Created: 2018-04-24T14:48:39.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-26T15:19:53.000Z (over 7 years ago)
- Last Synced: 2025-01-22T14:22:40.016Z (12 months ago)
- Topics: browser, handler, javascript, outdated
- Language: TypeScript
- Homepage:
- Size: 172 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Outdated-Browser Handler
helps to detect old browsers and show warning message. Browser detection's based on [bowser](https://github.com/lancedikson/bowser).
## Installation
`npm install obh --save`
## How to use
```typescript
const { OutdatedBrowserHandler } from 'obh';
OutdatedBrowserHandler.handle(document.body, {
minVersions: {
msie: '10',
ios: '7.1',
safari: '6.1',
firefox: '28',
opera: '12.1',
edge: '12',
chrome: '21',
android: '4'
},
sourceUrl: 'https://path/to/file.html',
userAgent: navigator.userAgent
}).then(isOkay => {
if (isOkay) {
<...> // continue to work
}
});
```
or you can use
```typescript
const { OutdatedBrowserHandler } from 'obh';
OutdatedBrowserHandler.handle(document.body, {
minVersions: {
msie: '10',
ios: '7.1',
safari: '6.1',
firefox: '28',
opera: '12.1',
edge: '12',
chrome: '21',
android: '4'
},
template: `
Your browser is outdated
`,
userAgent: navigator.userAgent
}).then(isOkay => {
if (isOkay) {
<...> // continue to work
}
});
```
## License
Licensed as MIT. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.