Check if browser is Microsoft Edge
User agent sniffing is considered bad practice and should be avoided if possible.
$ npm install --save is-edge
const isEdge = require('is-edge');
isEdge();
isEdge({version: 38});
isEdge({userAgent: 'Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10136'});
Returns a boolean
.
Type: string
User agent to test.
Type: string
, number
Check for specific version.
MIT © Andreas Gillström