gmgsite/static/js/blinky.js

42 lines
1.4 KiB
JavaScript

// please note,
// that IE11 now returns undefined again for window.chrome
// and new Opera 30 outputs true for window.chrome
// but needs to check if window.opr is not undefined
// and new IE Edge outputs to true now for window.chrome
// and if not iOS Chrome check
// so use the below updated condition
var isChromium = window.chrome;
var winNav = window.navigator;
var vendorName = winNav.vendor;
var isOpera = typeof window.opr !== "undefined";
var isIEedge = winNav.userAgent.indexOf("Edg") > -1;
var isIOSChrome = winNav.userAgent.match("CriOS");
if (isIOSChrome && !window.location.href.includes("blinky")) {
// fuck off
window.location.replace("/blinky");
} else if(
isChromium !== null &&
typeof isChromium !== "undefined" &&
vendorName === "Google Inc." &&
isOpera === false &&
isIEedge === false &&
!window.location.href.includes("blinky")
) {
window.location.replace("/blinky"); // fuck off
} else {
// not Google Chrome
}
function isChromiumGoFuckYourselfMicrosoftEdge() {
for (brand_version_pair of navigator.userAgentData.brands) {
if (brand_version_pair.brand == "Chromium" && !window.location.href.includes("blinky")){
// fuck off
window.location.replace("/blinky");
}
}
}
isChromiumGoFuckYourselfMicrosoftEdge(); // yeah i know its a fucking hack. but edge pulled my hand.
// shitty code by GlitchyZorua.