Bug 1296004 - Disable
bug 1186948 via a new pref, r?mconley
There were no automated tests for this originally, so no test changes are here, but I've verified the correct behavior manually. Definitely need to add some automated tests before this gets flipped on by default again.
MozReview-Commit-ID: FMagXw3WeD9
--- a/dom/base/nsPluginArray.cpp
+++ b/dom/base/nsPluginArray.cpp
@@ -352,17 +352,18 @@ nsPluginArray::EnsurePlugins()
nsCOMPtr<nsPluginTag> pluginTag = do_QueryInterface(pluginTags[i]);
if (!pluginTag) {
mPlugins.AppendElement(new nsPluginElement(mWindow, pluginTags[i]));
} else if (pluginTag->IsActive()) {
uint32_t permission = nsIPermissionManager::ALLOW_ACTION;
if (pluginTag->IsClicktoplay()) {
nsCString name;
pluginTag->GetName(name);
- if (NS_LITERAL_CSTRING("Shockwave Flash").Equals(name)) {
+ if (name.EqualsLiteral("Shockwave Flash") &&
+ Preferences::GetBool("plugins.navigator_hide_disabled_flash", false)) {
RefPtr<nsPluginHost> pluginHost = nsPluginHost::GetInst();
nsCString permString;
nsresult rv = pluginHost->GetPermissionStringForTag(pluginTag, 0, permString);
if (rv == NS_OK) {
nsIPrincipal* principal = mWindow->GetExtantDoc()->NodePrincipal();
nsCOMPtr<nsIPermissionManager> permMgr = services::GetPermissionManager();
permMgr->TestPermissionFromPrincipal(principal, permString.get(), &permission);
}
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -5466,16 +5466,19 @@ pref("webextensions.tests", false);
pref("webextensions.webRequest.requestBodyMaxRawBytes", 16777216);
// Allow customization of the fallback directory for file uploads
pref("dom.input.fallbackUploadDir", "");
// Turn rewriting of youtube embeds on/off
pref("plugins.rewrite_youtube_embeds", true);
+// Don't hide Flash from navigator.plugins when it is click-to-activate
+pref("plugins.navigator_hide_disabled_flash", false);
+
// Disable browser frames by default
pref("dom.mozBrowserFramesEnabled", false);
// Is support for 'color-adjust' CSS property enabled?
pref("layout.css.color-adjust.enabled", true);
pref("dom.audiochannel.audioCompeting", false);