File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -524,16 +524,20 @@ exports.Window = function(context, dom) {
524524var WindowPrototype = exports . Window . prototype = Object . create ( _globals . core . RAIIEventEmitter . prototype )
525525WindowPrototype . constructor = exports . Window
526526
527+ var useDevicePixelRatio = function ( ) {
528+ return ! ! window . cordova
529+ }
530+
527531WindowPrototype . width = function ( ) {
528- if ( navigator . userAgent . toLocaleLowerCase ( ) . match ( 'android' ) ) {
532+ if ( useDevicePixelRatio ( ) ) {
529533 return Math . floor ( this . dom . innerWidth * this . dom . devicePixelRatio ) ;
530534 } else {
531535 return this . dom . innerWidth ;
532536 }
533537}
534538
535539WindowPrototype . height = function ( ) {
536- if ( navigator . userAgent . toLocaleLowerCase ( ) . match ( 'android' ) ) {
540+ if ( useDevicePixelRatio ( ) ) {
537541 return Math . floor ( this . dom . innerHeight * this . dom . devicePixelRatio ) ;
538542 } else {
539543 return this . dom . innerHeight ;
You can’t perform that action at this time.
0 commit comments