By default the runtime is hosted in a Web Worker, where there is no direct access to the DOM (window
, document
etc.) You can force the project to run in the DOM by setting 'Use worker' to 'No' in project properties, and this will allow such calls to work again.
However addons can support this in a web worker using a specially designed DOM call mechanism in the runtime. This is documented in the addon SDK manual.
Global variables are not exposed in the SDK. This is because a well-designed addon should not hard code such things. It should just make the information available, e.g. via an expression, and then the user can assign that to a global variable in the event system.