Detecting enabled Flash in HTA with Javascript

Batch, ASP, JScript, Kixtart, etc.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 13 years and 9 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
susanlxk
Posts: 1
Last visit: Thu Jun 24, 2010 3:46 am

Detecting enabled Flash in HTA with Javascript

Post by susanlxk »

Scenario: User has disabled Flash in Internet Explorer. An HTML file with the following Javascript is launched in IE and also in an HTA.

Script:

Code: Select all

function isFlashSupported(){
	
     if (window.navigator.plugins && navigator.plugins.length){
	
          return navigator.plugins[Shockwave Flash 6.0] || navigator.plugins[Shockwave Flash];
	
     }
	
     try{
	
          // IE style
	
          return Boolean(new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"));
	
     }
	
     catch(e){
	
          return false;
	
     }
	
}


Results:
When Flash is disabled, returns false when viewed in IE, but returns true when viewed in the HTA.

Desired result:
If the customer has disabled Flash, the HTA should honor that. Is there a way to detect whether Flash is disabled (not just that it's installed)?

Thanks,
Susan
This topic is 13 years and 9 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked