阻止某些屏幕分辨率查看网站?

Block certain screen resolutions from viewing website?

是否可以通过屏幕分辨率以某种方式阻止某些计算机查看网站?

我考虑的方法是使用 var a = window.screen.heightvar b = window.screen.width,然后使用 <pre id=res></pre>document.getElementById("res").textContent=b+" x "+a;,现在是我需要帮助的部分。 . 我该怎么做才能if res.textContent=1234 x 1234 then allow, but else redirect...发送帮助!

-gr3uh

我想出了一个解决问题的方法,无论如何感谢您的反馈,原来我只需要制作一个这样的脚本...

var screenSizeIn = screen.width + " X " +
  screen.height;

console.log("Screen size is: " + screenSizeIn);
if (screenSizeIn == "1280 X 720") { // <-- good screen size
  console.log("Screen size is good!");
} else { // <-- bad screen size
  window.location = "/blocked.html"; // <-- what to do when wrong
  console.log("Screen size is wrong!");
}