polyfills.screen.orientation.min.js Maven / Gradle / Ivy
The newest version!
!function(){function n(){var n;return o&&(n=o.call(window.screen)),"object"==typeof n?n:(void 0===n&&(n=screen.width>screen.height?"landscape-primary":"portrait-primary"),{type:n,angle:-1!==n.indexOf("secondary")?180:0,onchange:function(){throw new Error("onchange"+r)},lock:function(){throw new Error("lock method"+r)},unlock:function(){throw new Error("unlock method"+r)}})}var e,o,r=" not supported in the screen.orientation polyfill";if("orientation"in screen?e="orientation":"mozOrientation"in screen?e="mozOrientation":"msOrientation"in screen&&(e="msOrientation"),o="getOwnPropertyDescriptor"in Object&&Object.getOwnPropertyDescriptor(window.screen,e)||"__lookupGetter__"in window.screen&&window.screen.__lookupGetter__(e),"screen"in window||(window.screen={}),"object"!=typeof window.screen.orientation)try{Object.defineProperty(window.screen,"orientation",{get:n})}catch(t){try{window.screen.orientation=n()}catch(i){}}}();