made latestKnownScrollY global var so it can be used by DOMContentLoaded event listener