Skip to content

Commit

Permalink
added and fixed screen info for context.screen for device mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ruchiramoitra committed Jun 14, 2021
1 parent 74fc650 commit 6f9de46
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions utils/RudderContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ class RudderContext {
this.locale = null;
} else {
// running within browser
screen.width = window.width;
screen.height = window.height;
screen.width = window.screen.width;
screen.height = window.screen.height;
screen.density = window.devicePixelRatio;
this.userAgent = navigator.userAgent;
// property name differs based on browser version
this.locale = navigator.language || navigator.browserLanguage;
screen.innerWidth = window.innerWidth;
screen.innerHeight = window.innerHeight;
}
this.os = os;
this.screen = screen;
Expand Down
2 changes: 2 additions & 0 deletions utils/RudderInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class RudderScreenInfo {
this.density = 0;
this.width = 0;
this.height = 0;
this.innerWidth = 0;
this.innerHeight = 0;
}
}
// Device information class
Expand Down

0 comments on commit 6f9de46

Please sign in to comment.