Fix viewport width detection on Chrome