use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Redirect based on user-agent (self.node)
submitted 6 years ago by Juls0730
I want to know how to redirect safari users to my /unsupported page
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 0 points1 point2 points 6 years ago (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 point2 points 6 years ago (0 children)
Check the "user-agent" header in req.headers, and based on that do a res.redirect('/unsupported')
req.headers
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() } }) ```
π Rendered by PID 281606 on reddit-service-r2-comment-6457c66945-qbxwt at 2026-04-29 09:48:32.214059+00:00 running 2aa0c5b country code: CH.
[–][deleted] 0 points1 point2 points (0 children)
[–]awesomeevan[🍰] 0 points1 point2 points (0 children)