检查Chrome是否在Angular中启用了Flash 2

Check whether Chrome has enabled Flash in Angular 2

  1. 我们如何查看天气 chrome 在 Angular 2
  2. 中启用了 Flash
  3. 在chrome://Flags中,有一个属性'Prefer HTML over Flash'。我们如何读取 chrome://Flags 属性?

我不确定你是否可以直接读取标志。您还需要考虑不同的浏览器以及代码将如何影响它们。

过去我曾使用 Modernizr 进行此类功能测试。 Modernizr 是一个 Javascript 库,允许您创建测试并根据该功能是否存在隐藏或启用网站或网络应用程序的特定部分。

https://modernizr.com/download?setclasses&q=flash


引自 Modernizr 网站:

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.