get global scope reference in a cross-platform way