Accessing JavaScript Global Object from IE COM

2020-02-10 10:28发布

问题:

Looking at Compatibility changes in IE11, we have that window.execScript is replaced with eval. Now when using the IE COM object how can we get hold of the JavaScript Global Object that has the eval function?

PowerShell:

$ie = New-Object -COM InternetExplorer.Application
$document = $ie.document
$window = $document.parentWindow
# How to get JavaScript Global Object from these?

See also this related question.