if(/f(?=1-)/.test(window.location.pathname)) {
if(!/Android|webOS|iPhone|iPad|iPod|BlackBerry/gi.test(navigator.userAgent)) {
window.location.href= "/";
}
}
如果路徑名與f1-
開始,如果是這樣,它不是一個特定的userAgent回到主頁我測試。雖然即使在userAgent上,它仍然在重定向我...是我的正則表達式不正確?正則表達式測試路徑和移動設備
什麼是你的userAgent? – cwallenpoole
我在android和iOS – EasyBB