core: use this from global context instead window