devtools: prefer globalThis
over window
if available
#4401
Merged
globalThis
over window
if available
#4401