Bug 1348089 - Implement new plugin option for Flash as a checkbox to toggle the allow/blocklist feature (plugins.flashBlock.enabled). r=rhelmer
MozReview-Commit-ID: T71WrpQxD6
--- a/toolkit/locales/en-US/chrome/pluginproblem/pluginproblem.dtd
+++ b/toolkit/locales/en-US/chrome/pluginproblem/pluginproblem.dtd
@@ -24,8 +24,9 @@
<!ENTITY report.failed "Submission failed.">
<!ENTITY report.unavailable "No report available.">
<!ENTITY report.comment "Add a comment (comments are publicly visible)">
<!ENTITY report.pageURL "Include the page’s URL">
<!ENTITY plugin.file "File">
<!ENTITY plugin.mimeTypes "MIME Types">
<!ENTITY plugin.flashProtectedMode.label "Enable Adobe Flash protected mode">
+<!ENTITY plugin.enableBlocklists.label "Block dangerous and intrusive Flash content">
--- a/toolkit/mozapps/extensions/content/pluginPrefs.xul
+++ b/toolkit/mozapps/extensions/content/pluginPrefs.xul
@@ -8,13 +8,17 @@
<vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<setting type="control" title="&plugin.file;">
<label class="text-list" id="pluginLibraries"/>
</setting>
<setting type="control" title="&plugin.mimeTypes;">
<label class="text-list" id="pluginMimeTypes"/>
</setting>
+ <setting type="bool" pref="plugins.flashBlock.enabled"
+ id="pluginFlashBlocking"
+ title="&plugin.enableBlocklists.label;"
+ learnmore="https://support.mozilla.org/kb/flash-blocklists" />
<setting type="bool" pref="dom.ipc.plugins.flash.disable-protected-mode"
inverted="true" title="&plugin.flashProtectedMode.label;"
id="pluginEnableProtectedMode"
learnmore="https://support.mozilla.org/kb/flash-protected-mode-settings" />
</vbox>
--- a/toolkit/mozapps/extensions/internal/PluginProvider.jsm
+++ b/toolkit/mozapps/extensions/internal/PluginProvider.jsm
@@ -544,20 +544,17 @@ PluginWrapper.prototype = {
if (this.userDisabled !== false && !isCTPBlocklisted) {
permissions |= AddonManager.PERM_CAN_ENABLE;
}
}
return permissions;
},
get optionsType() {
- if (canDisableFlashProtectedMode(this)) {
- return AddonManager.OPTIONS_TYPE_INLINE;
- }
- return AddonManager.OPTIONS_TYPE_INLINE_INFO;
+ return AddonManager.OPTIONS_TYPE_INLINE;
},
get optionsURL() {
return "chrome://mozapps/content/extensions/pluginPrefs.xul";
},
get updateDate() {
return this.installDate;
--- a/toolkit/mozapps/extensions/test/browser/browser_pluginprefs.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_pluginprefs.js
@@ -30,21 +30,21 @@ add_test(function() {
testPluginId = plugin.id;
break;
}
}
ok(testPluginId, "Test Plug-in should exist")
AddonManager.getAddonByID(testPluginId, function(testPlugin) {
let pluginEl = get_addon_element(gManagerWindow, testPluginId);
- is(pluginEl.mAddon.optionsType, AddonManager.OPTIONS_TYPE_INLINE_INFO, "Options should be inline info type");
+ is(pluginEl.mAddon.optionsType, AddonManager.OPTIONS_TYPE_INLINE, "Options should be inline type");
pluginEl.parentNode.ensureElementIsVisible(pluginEl);
let button = gManagerWindow.document.getAnonymousElementByAttribute(pluginEl, "anonid", "preferences-btn");
- is_element_hidden(button, "Preferences button should be hidden");
+ is_element_visible(button, "Preferences button should be hidden");
button = gManagerWindow.document.getAnonymousElementByAttribute(pluginEl, "anonid", "details-btn");
EventUtils.synthesizeMouseAtCenter(button, { clickCount: 1 }, gManagerWindow);
wait_for_view_load(gManagerWindow, function() {
let pluginLibraries = gManagerWindow.document.getElementById("pluginLibraries");
ok(pluginLibraries, "Plugin file name row should be displayed");
// the file name depends on the platform