expose a global if window is present
add newline
Merge pull request #2943 from patrickarlt/expose-global

expose a global if window is present