diff options
author | amzrk2 | 2020-06-07 20:37:14 +0800 |
---|---|---|
committer | amzrk2 | 2020-06-07 20:37:14 +0800 |
commit | e8d4288574e2c8309d77932f5ac511da8664ad41 (patch) | |
tree | f231de13293e812fde8f6073c69e417ccb9f7e2a /layouts/partials/scripts-front.html | |
parent | 8ef40205157bf79da847f4417f54d5aabc206b2e (diff) | |
download | hugo-theme-fuji-e8d4288574e2c8309d77932f5ac511da8664ad41.tar.gz hugo-theme-fuji-e8d4288574e2c8309d77932f5ac511da8664ad41.tar.bz2 hugo-theme-fuji-e8d4288574e2c8309d77932f5ac511da8664ad41.zip |
Update browser detection
Diffstat (limited to 'layouts/partials/scripts-front.html')
-rw-r--r-- | layouts/partials/scripts-front.html | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/layouts/partials/scripts-front.html b/layouts/partials/scripts-front.html index c516aad..6b4d78b 100644 --- a/layouts/partials/scripts-front.html +++ b/layouts/partials/scripts-front.html @@ -13,16 +13,15 @@ </script> <script data-cfasync="false"> // ie detection - var ua = window.navigator.userAgent; - - function browserDetection() { - if (ua.indexOf('MSIE ') > 0 || ua.indexOf('Trident/') > 0 || ua.indexOf('Edge/') > 0) { + function browserDetection(ua) { + if (ua.indexOf('MSIE ') > 0 || ua.indexOf('Trident/') > 0) { return true; } return false; } - if (browserDetection()) { + var ua = window.navigator.userAgent; + if (browserDetection(ua)) { window.location.href('{{ "/ie/" | absURL }}'); } </script>
\ No newline at end of file |