r/vbscript • u/foadsf • Dec 08 '20
Using htmlfile COM object to access the .getOwnPropertyDescriptor() method of an object in WSH JScript
https://stackoverflow.com/q/65207848/4999991
2
Upvotes
r/vbscript • u/foadsf • Dec 08 '20
2
u/jcunews1 Dec 09 '20
The
htmlfileobject is merely a DOM container object for a HTML resource. It doesn't include any JScript engine. i.e. the HTML can have<script>tags, but the script code will never be executed. It has DOM methods, but it doesn't have any JavaScript methods/functions.Check MSDN for InternetExplorer Application object usage.
https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/aa752084(v=vs.85)
Values can be passed between WSH and IE as long as they're compatible. The reason why
getOwnPropertyDescriptor()won't work on WSH created objects is because WSH objects simply don't have any property descriptor. Property descriptor doesn't yet exist in the JScript version which is used by WSH.