Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="UTF-8" Message-ID: <1581559.TFT1m0cKLP@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Sun, 17 Nov 2013 00:08:02 +0100 User-Agent: KNode/4.10.5 Content-Transfer-Encoding: 8Bit X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. MIME-Version: 1.0 Lines: 84 NNTP-Posting-Date: 17 Nov 2013 00:09:41 CET NNTP-Posting-Host: 902843f6.newsspool1.arcor-online.net X-Trace: DXC=\6S84BA309C@k=MdN::NBIic==]BZ:afN4Fo<]lROoRAnkgeX?EC@@@c43BI^Y;R1GDZm8W4\YJNLYUVHKH;GI^G>i:cQJahJ7GHF@>@0f:LaJ X-Complaints-To: usenet-abuse@arcor.de Xref: csiph.com comp.lang.javascript:22025 Christoph Michael Becker wrote: > In IE11 Fascinating. > (JScript 11.0? -- I was not able to find out the exact version) Relevant JScript versions for which results have been submitted to the ECMAScript Support Matrix are so far - Version 11.0.16412 in "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; Touch; rv:11.0) like Gecko" (presumably, Internet Explorer 11 on a smartphone or tablet, as indicated by “Touch”) - Version 11.0.16428 in "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko" (presumably, Internet Explorer 11 on a PC without a touchscreen) You can use (much like I did) ScriptEngine() + " " + [ ScriptEngineMajorVersion(), ScriptEngineMinorVersion(), ScriptEngineBuildVersion() ].join(".") See also , and the corresponding test cases. > the following is true[1]: > > typeof window.ActiveXObject == "undefined" You should not presume that “ActiveXObject” is a property of the object referred to by “window”. In general, “window” should not be used for a reference to the ECMAScript Global Object (use “this” in the global execution context instead). Test for exactly that which you are using later. If you want to call “new ActiveXObject” later, test for “ActiveXObject”, not “window.ActiveXObject”. That said, is “new ActiveXObject(…)” or “new window.ActiveXObject(…)” supported then? If not, everything works as designed. “ActiveXObject” is a very old feature which repeatedly introduced security leaks in MSHTML-based applications and Windows; I would not be surprised if it was finally removed from the JScript language as a result. For example, “file:” URIs aside, you do not need “ActiveXObject” for XHR in recent JScript versions; use “new XMLHttpRequest()” instead (like almost everywhere else). > This causes isHostMethod()[2] to fail. AFAICS (I have just tested this positive in IE 6.0.2800.1106 on Wine XP which can create, for example, "Microsoft.XMLHTTP" objects), “ActiveXObject” always referred to a *native* method, and yielded "function" (not "unknown") as result of a “typeof“ operation. AFAIK it is a built-in JScript feature even though it creates only host objects, and is therefore tested with the ES Matrix. > Is there a reliable solution to detect if the window object has an > ActiveXObject method, without actually /try/ing to instantiate a new > ActiveXObject? Depends. try…catch at least is the only reliable way to determine whether a host object of a certain class (sic!; as in CLSID) can be successfully created when “ActiveXObject” is called as a constructor where try…catch is supported (that would apply to these versions of JScript). > [1] > [2] > There are three versions of isHostMethod() there – which one have you used? JSX:object.js has another one. However, following my argument above, Peter Michaux’s argument is flawed and none of those methods should be used on “ActiveXObject”. -- PointedEars Twitter: @PointedEars2 Please do not Cc: me. / Bitte keine Kopien per E-Mail.