summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoramzrk22020-06-07 20:37:14 +0800
committeramzrk22020-06-07 20:37:14 +0800
commite8d4288574e2c8309d77932f5ac511da8664ad41 (patch)
treef231de13293e812fde8f6073c69e417ccb9f7e2a
parent8ef40205157bf79da847f4417f54d5aabc206b2e (diff)
downloadhugo-theme-fuji-e8d4288574e2c8309d77932f5ac511da8664ad41.tar.gz
hugo-theme-fuji-e8d4288574e2c8309d77932f5ac511da8664ad41.tar.bz2
hugo-theme-fuji-e8d4288574e2c8309d77932f5ac511da8664ad41.zip
Update browser detection
-rw-r--r--layouts/partials/scripts-front.html9
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