I understand that the KM variables are contained in document.kmvar. But I'm trying to access a global variable.
From the Chrome console of the site I can access the variables as 'TWA', global.TWA or window.TWA. I need to look up some information in that variable to make my KM macro work.
Unfortunately when trying to access 'window', the browser returns only the attributes that exist on the Window object defined by Chrome and not any global variables set via the site's JS code.
e.g. window.devicePixelRatio or just devicePixelRatio returns 2 (as expected) but window.TWA is undefined and alert(window.hasOwnProperty('devicePixelRatio')) is true, while alert(window.hasOwnProperty('TWA')) is not.
Any idea how to access custom global vars via KM?