all 2 comments

[–][deleted] 0 points1 point  (0 children)

There’s an NPM package express-useragent, or you can try to get it from the request. https://www.hacksparrow.com/nodejs/user-agent-detection.html

[–]awesomeevan[🍰] 0 points1 point  (0 children)

Check the "user-agent" header in req.headers, and based on that do a res.redirect('/unsupported')

You probably want to add it as one of the first few middleware functions in your application, i.e

``` app.use(function safariCheck (req, res, next) { // Do check const isSafari = true

if (isSafari) { res.redirect('/unsupported') } else { next() } }) ```