Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Internet Explorer check compatible with uglify #43

Closed
renholm opened this issue Feb 26, 2015 · 6 comments
Closed

Make Internet Explorer check compatible with uglify #43

renholm opened this issue Feb 26, 2015 · 6 comments

Comments

@renholm
Copy link

renholm commented Feb 26, 2015

The isOldInternetExplorer variable is always false if using uglify (and maybe other minification methods) since comments gets stripped. I suggest changing to another method for checking Internet Explorer versions.

@rodneyrehm
Copy link
Owner

sounds reasonable. PR welcome!

@dillonlucente
Copy link

We ran into a similar issue here with the updated version of this library. Uglify was moving the @cc_on comments out from where they originally existed in the code, so it executes those checks outside of the initialization block. It's too late to assign variables, even if they did exist in the global namespace.

Since there's some user agent sniffing going on for iOS and Android, we just moved the checking for buggy and old IEs to the same format, specifically:

  var isBuggyIE = /MSIE [0-9]\./i.test(userAgent);
  var isOldIE = /MSIE [0-8]\./i.test(userAgent);

The regex is a bit hacky, but at least the idea should be sound, unless I'm missing something that you ran into. I guess you could do some more checking, like MS does here.

This might close #40 as well. If this sounds good, I'd be happy to do a PR.

Great library, by the way, saved us days of headaches.

@rodneyrehm
Copy link
Owner

looks good to me. any objections from @zoltan-dulac (who originally authored this part)? feel free to send a PR :)

rodneyrehm added a commit that referenced this issue Jul 15, 2015
Use user agent sniffing to detect IE9 - #43, #40
@rodneyrehm
Copy link
Owner

thank you for the fix, it's released as v0.5.4

@dillonlucente
Copy link

No problem, hope it works out.

-- 
Dillon Lucente
WILL Interactive

On July 15, 2015 at 12:31:44 PM, Rodney Rehm (notifications@github.com) wrote:

thank you for the fix, it's released as v0.5.4


Reply to this email directly or view it on GitHub.

@renholm
Copy link
Author

renholm commented Aug 3, 2015

Great work, thanks! @dillonlucente @rodneyrehm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants