0

I know, IE 8 and 9 are out of date. But I need to check the flash plugin there. They don't provide a useful navigator.plugins array, so I looking for alternatives. One can be found here.

Another one is something like this:

var a = void(0);
window.execScript("On error resume next: a = IsObject(CreateObject('ShockwaveFlash.ShockwaveFlash.11'))", "VBScript");
console.log(a); //-> undefined

or:

var a = 'jess';
window.execScript("On error resume next: a = IsObject(CreateObject('ShockwaveFlash.ShockwaveFlash.11'))", "VBScript");
console.log(a); //-> 'jess'

or:

var a = false;
window.execScript("On error resume next: a = IsObject(CreateObject('ShockwaveFlash.ShockwaveFlash'))", "VBScript"); //no version string here
console.log(a); //-> false

It seems like either execScript or the VBScript does not change the value of a at all.

I'm guessing, that there is an issue with the scope, in which this script is executed (there is no access to a) - or a similar problem. I've tried this piece of code in an anonymous function and in the console.

Does anybody ever hit that issue? Is there any explanation or solution? Thank you very much!

1
  • Additionally: is it true, that a will only be manipulated, if IsObject returns true? Commented Sep 18, 2014 at 11:13

1 Answer 1

0

Alright, the main issue was a missing line break in the VBScript (or in the JS string, which pretends to be VBScript).

Instead of:

window.execScript("On error resume next: a = IsObject(CreateObject('ShockwaveFlash.ShockwaveFlash.10'))", "VBScript");

you must write:

window.execScript("On error resume next:\n a = IsObject(CreateObject('ShockwaveFlash.ShockwaveFlash.10'))", "VBScript");

That works. I'm not familiar with Basic or VBScript, but I've thought about it and figured, that it will need a line break to know, that a new command follows.

I'm still not sure, whether the assumption is correct, that window.execScript or IsObject (VBScript) changes the value of the JS variable only, if the result is true.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.