Skip to content
This repository has been archived by the owner on Aug 19, 2024. It is now read-only.

Commit

Permalink
Unsupported browser redirect script outputted to file (getredash#3832)
Browse files Browse the repository at this point in the history
  • Loading branch information
ranbena authored May 27, 2019
1 parent 28e9740 commit 5dff5b9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 24 deletions.
13 changes: 1 addition & 12 deletions client/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,7 @@
<meta charset="UTF-8">
<base href="/">
<title>Redash</title>
<script>
function onIE() {
window.location.href = '/static/unsupported';
}
if (
navigator.userAgent.match('MSIE') || // IE10
navigator.appVersion.match('Trident/') // IE11
){
onIE();
}
</script>
<!--[if IE]><script>onIE()</script><![endif]-->
<script src="/static/unsupportedRedirect.js" async></script>

<link rel="icon" type="image/png" sizes="32x32" href="/static/images/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="/static/images/favicon-96x96.png">
Expand Down
13 changes: 1 addition & 12 deletions client/app/multi_org.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,7 @@
<meta charset="UTF-8">
<base href="{{base_href}}">
<title>Redash</title>
<script>
function onIE() {
window.location.href = '/static/unsupported';
}
if (
navigator.userAgent.match('MSIE') || // IE10
navigator.appVersion.match('Trident/') // IE11
){
onIE();
}
</script>
<!--[if IE]><script>onIE()</script><![endif]-->
<script src="/static/unsupportedRedirect.js" async></script>

<link rel="icon" type="image/png" sizes="32x32" href="/static/images/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="/static/images/favicon-96x96.png">
Expand Down
6 changes: 6 additions & 0 deletions client/app/unsupportedRedirect.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
if (
navigator.appVersion.match('Trident/') || // IE8-11
'ActiveXObject' in window // IE<11
) {
window.location.href = '/static/unsupported';
}
1 change: 1 addition & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ const config = {
new CopyWebpackPlugin([
{ from: "client/app/assets/robots.txt" },
{ from: "client/app/unsupported.html" },
{ from: "client/app/unsupportedRedirect.js" },
{ from: "client/app/assets/css/*.css", to: "styles/", flatten: true },
{ from: "node_modules/jquery/dist/jquery.min.js", to: "js/jquery.min.js" }
])
Expand Down

0 comments on commit 5dff5b9

Please sign in to comment.