在 Chrome 中禁用 Flash [英] Disabling flash in Chrome
问题描述
我们的一个内部应用程序在页面上有一个 flash 对象.当浏览器中没有可用/安装 Flash 插件时,我需要测试一种极端情况:既不是内部 (pepperflash),也不是系统范围的 adobe flash player 插件.
One of our internal applications has a flash object on a page. I need to test one of the corner cases when there is no flash plugin available/installed in the browser: neither the internal (pepperflash), nor the system-wide adobe flash player plugin.
根据 Chromium 命令行开关列表 文档页面,有一个相关的命令行开关:
According to the List of Chromium Command Line Switches documentation page, there is a relevant command-line switch:
--disable-bundled-ppapi-flash
- 禁用 Flash 的捆绑 PPAPI 版本.
--disable-bundled-ppapi-flash
- Disables the bundled PPAPI version of Flash.
但是,这只会关闭pepperflash 内部chrome 插件.
But, this would turn off only the pepperflash internal chrome plugin.
根据如何运行 Chrome/Firefox 并从 watir 脚本禁用 flash 插件? 线程,还有 --disable-internal-flash
开关,但它也与 chrome 的内部 flash 插件有关.
According to the How to run Chrome/Firefox with disabled flash plugin from watir script? thread, there is also --disable-internal-flash
switch, but it is also relevant to the chrome's internal flash plugin.
Browserstack 的文档建议遵循以下原则"断头台是最好的头皮屑治疗方法,并使用 --disable-plugins
开关禁用所有插件:
Browserstack's documentation suggests to follow the principle "the guillotine is the best dandruff cure" and to disable all plugins by using --disable-plugins
switch:
要在 Chrome 中禁用 Flash,请创建一个 chromeOptions 功能,然后将 --disable-plugins 参数传递给功能.
To disable Flash in Chrome, create a chromeOptions capability, and pass the --disable-plugins argument to the capability.
有没有办法在不禁用 Chrome 中的所有插件的情况下禁用所有 Flash 插件?
Is there a way to disable all flash plugins without disabling all plugins in Chrome?
例如,可以优先列出所有需要关闭的插件:
For instance, would be perfect to have a preference to list all of the plugins that needs to be turned off:
plugins.disabled: ['Adobe Flash Player', 'pepperflash']
推荐答案
找到了,有另一个开关,它告诉 chrome 根本不要加载外部插件:
Found it, there is an another switch which tells chrome not to load external plugins at all:
--disable-plugins-discovery
禁用发现第三方插件.仅有效加载浏览器附带的内容 plus由 --extra-plugin-dir 和 --load-plugin 指定的第三方开关.
--disable-plugins-discovery
Disable discovering third-party plug-ins. Effectively loading only ones shipped with the browser plus third-party ones as specified by --extra-plugin-dir and --load-plugin switches.
通过结合 --disable-internal-flash
和 --disable-plugins-discovery
我已经实现了在 Chrome 中禁用所有 flash 插件.
By combining --disable-internal-flash
and --disable-plugins-discovery
I've achieved disabling all flash plugins in Chrome.
这篇关于在 Chrome 中禁用 Flash的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!