I am currently using the code below to block phones:
if {
/Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Kindle|Silk|Opera Mini/i
.test(navigator.userAgent)) {
window.location = "www.zentriamc.com/teachers/error.html"
}
How can I modify this code (or use a different one) on another webpage, to block all devices except for those listed above (not exclusively PCs)?