remove support for opera and opera based browsers

This commit is contained in:
Ashley 2023-03-10 15:35:45 +00:00
parent ee0db73952
commit 832e562cfb

View file

@ -9,11 +9,22 @@ function init(app, config, rendertemplate) {
app.get("/*", function (req, res, next) {
if (didstart) return next();
const userAgent = req.useragent.source;
if (
userAgent.includes("Opera") ||
userAgent.includes("OPR") ||
userAgent.includes("OPRGX")
) {
// Browser agent is Opera, Opera GX or OPRGX
res.redirect("https://www.mozilla.org/en-US/firefox/all/");
} else {
// Browser agent is not Opera, Opera GX or OPRGX
next();
}
return rendertemplate(res, req, "timeout.ejs");
});
setTimeout(function () {
didstart = true;