ie10-viewport-bug-workaround.js 668 B

123456789101112131415161718192021222324
  1. /*!
  2. * IE10 viewport hack for Surface/desktop Windows 8 bug
  3. * Copyright 2014-2017 The Bootstrap Authors
  4. * Copyright 2014-2017 Twitter, Inc.
  5. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  6. */
  7. // See the Getting Started docs for more information:
  8. // https://getbootstrap.com/getting-started/#support-ie10-width
  9. (function () {
  10. 'use strict'
  11. if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
  12. var msViewportStyle = document.createElement('style')
  13. msViewportStyle.appendChild(
  14. document.createTextNode(
  15. '@-ms-viewport{width:auto!important}'
  16. )
  17. )
  18. document.head.appendChild(msViewportStyle)
  19. }
  20. }())