mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-23 01:17:47 +01:00
remove support for opera and opera based browsers
This commit is contained in:
parent
ee0db73952
commit
832e562cfb
1 changed files with 13 additions and 2 deletions
|
@ -9,10 +9,21 @@ function init(app, config, rendertemplate) {
|
||||||
|
|
||||||
app.get("/*", function (req, res, next) {
|
app.get("/*", function (req, res, next) {
|
||||||
if (didstart) return 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");
|
return rendertemplate(res, req, "timeout.ejs");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
didstart = true;
|
didstart = true;
|
||||||
|
@ -77,7 +88,7 @@ function init(app, config, rendertemplate) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
}, 46000); /* setInterval */
|
}, 46000); /* setInterval */
|
||||||
}, 46000);
|
}, 46000);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
initlog("[FAILED] Load pages \n" + err);
|
initlog("[FAILED] Load pages \n" + err);
|
||||||
|
|
Loading…
Reference in a new issue