Closed alonashkenazi closed 10 years ago
verified tab and window cases on Mac in Chrome, FF, and Safari (non-iframe)
iframe cases: Tab focus is reported correctly in Safari, Firefox and Chrome on Mac, but when the window is NOT focused (but the tab is up), focus is always reported as true.
As described in the spreadsheet. This is the expected behavior
On Jul 10, 2014, at 5:56 PM, bdementatbrightroll notifications@github.com wrote:
iframe cases: Tab focus is reported correctly in Safari, Firefox and Chrome on Mac, but when the window is focused (but the tab is up), focus is always reported as true.
— Reply to this email directly or view it on GitHub https://github.com/openvv/openvv/pull/34#issuecomment-48669967.
(non-iframe cases) On Windows in Chrome and Firefox, tab focus is reported correctly, but window focus is always reported as true unless the window is minimized.
On Windows in IE, tab and window focus is always reported as false.
Which IE version did you use?
IE8, here's the user agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0
You can see in this link https://docs.google.com/a/doubleverify.com/spreadsheets/d/1542E5-3MompVig-kQPuF2xtXSuVKGYmGB5HrN8_qa8U/edit#gid=0that I haven't tested IE8.
On Fri, Jul 11, 2014 at 2:01 PM, bdementatbrightroll < notifications@github.com> wrote:
IE8, here's the user agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0
— Reply to this email directly or view it on GitHub https://github.com/openvv/openvv/pull/34#issuecomment-48762863.
I'm assuming that IE8 fail in the focus check because the way IN_IFRAME is detected: this.IN_IFRAME = (parent !== window); You can read on it here: http://stackoverflow.com/questions/4850978/ie-bug-window-top-false I suggest to change the check to: this.IN_IFRAME = (parent != window); WDYT?
Another commenter suggested: window.top === window.self I agree with you that it should be changed and either solution looks good to me. I have a slight preference for window.top === window.self
I went ahead and made that modification.
If there is no additional comments. I would like to merge by tomorrow EOF and close the issue. (different issue was opened for Chrome/Mac focus detection in iframe)
The additional comments satisfy the concerns I had
Also added unit tests for browser detection
Fix wrong focus detection in case another window overlaps the browser window. Link to the expected focus detection: https://docs.google.com/a/doubleverify.com/spreadsheets/d/1542E5-3MompVig-kQPuF2xtXSuVKGYmGB5HrN8_qa8U/edit#gid=0