Test code
http://jsbin.com/dipijeqi/11
Effect:
chrome
The code copy is as follows:
window.devicePixelRatio: 2 (accurate)
screen.deviceXDPI / screen.logicalXDPI: NaN
window.outerWidth / window.innerWidth : 2
document.documentElement.offsetHeight / window.innerHeight : 0.020618556701030927 (with correlation)
window.top.outerWidth / window.top.innerWidth: 2
ff
The code copy is as follows:
window.devicePixelRatio: 1.5 (accurate)
screen.deviceXDPI / screen.logicalXDPI: NaN
window.outerWidth / window.innerWidth : 1.0114583333333333333333
document.documentElement.offsetHeight / window.innerHeight : 0.023391812865497075 (with correlation)
window.top.outerWidth / window.top.innerWidth: 1.01145833333333333333333
ie 8
The code copy is as follows:
window.devicePixelRatio: undefined
screen.deviceXDPI / screen.logicalXDPI: 1.5416666666666667 (around accurate)
window.outerWidth / window.innerWidth : NaN
document.documentElement.offsetHeight / window.innerHeight : NaN
window.top.outerWidth / window.top.innerWidth : NaN
ie11
The code copy is as follows:
window.devicePixelRatio: 1.5 (accurate)
screen.deviceXDPI / screen.logicalXDPI: 1.5
window.outerWidth / window.innerWidth : 1.0084033613445377
document.documentElement.offsetHeight / window.innerHeight : 0.02203856749311295 (with correlation)
window.top.outerWidth / window.top.innerWidth: 1.0084033613445377
ie10
The code copy is as follows:
window.devicePixelRatio: undefined
screen.deviceXDPI / screen.logicalXDPI: 1.5 (accurate)
window.outerWidth / window.innerWidth : 1.0084033613445377
document.documentElement.offsetHeight / window.innerHeight : 1
window.top.outerWidth / window.top.innerWidth: 1.0084033613445377
ie9
The code copy is as follows:
window.devicePixelRatio: undefined
screen.deviceXDPI / screen.logicalXDPI: 1.5 (accurate)
window.outerWidth / window.innerWidth : 1.0084033613445377
document.documentElement.offsetHeight / window.innerHeight : 1
window.top.outerWidth / window.top.innerWidth: 1.0084033613445377
360 6.3 (No response at all)
The code copy is as follows:
window.devicePixelRatio: undefined
screen.deviceXDPI / screen.logicalXDPI: 1
window.outerWidth / window.innerWidth : NaN
document.documentElement.offsetHeight / window.innerHeight : NaN
window.top.outerWidth / window.top.innerWidth : NaN
360 Speed Browser
The code copy is as follows:
window.devicePixelRatio: 1
screen.deviceXDPI / screen.logicalXDPI: NaN
window.outerWidth / window.innerWidth: 1.5
document.documentElement.offsetHeight / window.innerHeight : 0.015267175572519083
window.top.outerWidth / window.top.innerWidth: 1.5 (accurate)
Sogou High Speed Browser (No response at all)
The code copy is as follows:
window.devicePixelRatio: undefined
screen.deviceXDPI / screen.logicalXDPI: 1
window.outerWidth / window.innerWidth : NaN
document.documentElement.offsetHeight / window.innerHeight : NaN
window.top.outerWidth / window.top.innerWidth : NaN
Taobao browser
The code copy is as follows:
window.devicePixelRatio: 1
screen.deviceXDPI / screen.logicalXDPI: NaN
window.outerWidth / window.innerWidth : 2.0710059171597632 (roughly accurate)
document.documentElement.offsetHeight / window.innerHeight : 0.022988505747126436
window.top.outerWidth / window.top.innerWidth: 2.0710059171597632