Skip to content

Instantly share code, notes, and snippets.

@oobleck
Last active June 11, 2024 09:46
Show Gist options
  • Select an option

  • Save oobleck/8428063 to your computer and use it in GitHub Desktop.

Select an option

Save oobleck/8428063 to your computer and use it in GitHub Desktop.

Revisions

  1. oobleck revised this gist Jan 15, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ie10plus.modernizr.js
    Original file line number Diff line number Diff line change
    @@ -16,7 +16,7 @@ Modernizr.addTest('ie11', function() {
    // ('msTransform' in document.body.style)
    var match = (!!document.documentMode &&
    !document.all &&
    Modernizr.mq('only screen') &&
    (!!window.matchMedia || !!window.msMatchMedia) &&
    !Modernizr.websqldatabase &&
    !Modernizr.cssreflections);
    return match;
  2. oobleck created this gist Jan 14, 2014.
    23 changes: 23 additions & 0 deletions ie10plus.modernizr.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    // IE10
    Modernizr.addTest('ie10', function() {
    // http://stackoverflow.com/questions/9900311/how-do-i-target-only-internet-explorer-10-for-certain-situations-like-internet-e
    'use strict';
    var match = (/*@cc_on!@*/false && document.documentMode === 10);
    return match;
    });


    // IE11
    Modernizr.addTest('ie11', function() {
    // https://en.wikipedia.org/wiki/Internet_Explorer_11
    'use strict';
    // var ua = navigator.userAgent;
    // var match = /Trident.*rv[\s:]11\./i.test(ua);
    // ('msTransform' in document.body.style)
    var match = (!!document.documentMode &&
    !document.all &&
    Modernizr.mq('only screen') &&
    !Modernizr.websqldatabase &&
    !Modernizr.cssreflections);
    return match;
    });