Skip to content
This repository has been archived by the owner on May 22, 2021. It is now read-only.

redirect ie to /unsupported #353

Merged
merged 2 commits into from
Jul 31, 2017
Merged

redirect ie to /unsupported #353

merged 2 commits into from
Jul 31, 2017

Conversation

dannycoates
Copy link
Contributor

fixes #351

@@ -1,8 +1,16 @@
{{!-- This file should be es5 only --}}
var isIE = navigator.userAgent.toLowerCase().indexOf('msie') > -1 ||
!!navigator.userAgent.toLowerCase().match(/trident\/7\./);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of a double negation on .match(), we could possibly just use .test():

/trident\/7\./i.test(navigator.userAgent);

{{!-- This file should be es5 only --}}
var isIE = navigator.userAgent.toLowerCase().indexOf('msie') > -1 ||
!!navigator.userAgent.toLowerCase().match(/trident\/7\./);
var isUnsupportedPage = location.pathname.includes('/unsupported');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we can use .includes() here, per https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes#Browser_compatibility

May have to just use a cheap .indexOf('/unsupported') !== -1) or similar.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is what happens when I start a PR at 4:30 on Friday

@ericawright
Copy link
Contributor

ericawright commented Jul 31, 2017

So the redirect works, in much the same way that #352 did, but it still has the same issue in that the page shows up like this due to l10n not firing. (As well as some CSS issues, but that should hopefully be easily fixable once we have some text)
screen shot 2017-07-31 at 9 59 51 am

@dannycoates do you think you can get l10n working without es6?

@ericawright
Copy link
Contributor

screen shot 2017-07-31 at 11 54 33 am

@dannycoates the console errors for you

@dannycoates dannycoates merged commit 81be38f into master Jul 31, 2017
@dannycoates dannycoates deleted the no-ie branch July 31, 2017 21:38
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Redirect IE users to an /unsupported/ie page
4 participants