- How can we check weather chrome has enabled Flash in Angular 2
- In chrome://Flags, there is a property 'Prefer HTML over Flash'. How can we read chrome://Flags properties?

- 5
- 5
-
var _flash_installed = ((typeof navigator.plugins !== "undefined" && typeof navigator.plugins["Shockwave Flash"] === "object") || (window.ActiveXObject && (new ActiveXObject("ShockwaveFlash.ShockwaveFlash")) !== false)); – Yatin Patel Aug 10 '17 at 12:36
-
@Yatinpatel, Earlier I had tried this code in Angular 2 but I could not import library for ActiveXObject. How can we import it or What is its alternative in Angular 2? – Hashim Aug 11 '17 at 05:08
-
no need to include `ActiveXObject` lib. – Yatin Patel Aug 11 '17 at 10:06
-
@Yatinpatel , How can we resolve the error 'Cannot find name 'ActiveXObject'.? Please note this is in Angular2 – Hashim Aug 11 '17 at 12:31
1 Answers
I'm not sure whether you can read the flags directly. You would also need to consider different browsers and how the code would affect them.
In the past I've used Modernizr for these kind of feature tests. Modernizr is a Javascript library that allows you to create tests and hide or enable specific parts of your website or webapp based on whether that feature exists.
https://modernizr.com/download?setclasses&q=flash
Quoted from the Modernizr site:
What is Modernizr?
It’s a collection of superfast tests – or “detects” as we like to call them – which run as your web page loads, then you can use the results to tailor the experience to the user.
Why do I need it?
All web developers come up against differences between browsers and devices. That’s largely due to different feature sets: the latest versions of the popular browsers can do some awesome things which older browsers can’t – but we still have to support the older ones.
Modernizr makes it easy to deliver tiered experiences: make use of the latest and greatest features in browsers which support them, without leaving less fortunate users high and dry.

- 1
- 1

- 2,197
- 20
- 31