summaryrefslogtreecommitdiffstats
path: root/application/palemoon/components
diff options
context:
space:
mode:
Diffstat (limited to 'application/palemoon/components')
-rw-r--r--application/palemoon/components/permissions/aboutPermissions.js38
-rw-r--r--application/palemoon/components/permissions/aboutPermissions.xul2
-rw-r--r--application/palemoon/components/places/content/controller.js5
-rw-r--r--application/palemoon/components/preferences/applications.js105
4 files changed, 75 insertions, 75 deletions
diff --git a/application/palemoon/components/permissions/aboutPermissions.js b/application/palemoon/components/permissions/aboutPermissions.js
index 750dbaac3..6a02daa29 100644
--- a/application/palemoon/components/permissions/aboutPermissions.js
+++ b/application/palemoon/components/permissions/aboutPermissions.js
@@ -572,13 +572,7 @@ var AboutPermissions = {
permissionEntry.setAttribute("id", permString + "-entry");
// If the plugin is disabled, it makes no sense to change its
// click-to-play status, so don't add it.
- // If the click-to-play pref is not set and the plugin is not
- // click-to-play blocklisted, again click-to-play doesn't apply,
- // so don't add it.
- if (plugin.disabled ||
- (!Services.prefs.getBoolPref("plugins.click_to_play") &&
- (pluginHost.getStateForType(mimeType)
- != Ci.nsIPluginTag.STATE_CLICKTOPLAY))) {
+ if (plugin.disabled) {
permissionEntry.hidden = true;
} else {
permissionEntry.hidden = false;
@@ -588,10 +582,13 @@ var AboutPermissions = {
this._noGlobalDeny.push(permString);
Object.defineProperty(PermissionDefaults, permString, {
get: function() {
- return this.isClickToPlay()
- ? PermissionDefaults.UNKNOWN
- : PermissionDefaults.ALLOW;
- }.bind(permissionEntry),
+ if ((Services.prefs.getBoolPref("plugins.click_to_play") &&
+ plugin.clicktoplay) ||
+ permString.startsWith("plugin-vulnerable:")) {
+ return PermissionDefaults.UNKNOWN;
+ }
+ return PermissionDefaults.ALLOW;
+ },
set: function(aValue) {
this.clicktoplay = (aValue == PermissionDefaults.UNKNOWN);
}.bind(plugin),
@@ -1051,21 +1048,24 @@ var AboutPermissions = {
// which is reserved for site-specific preferences only.
document.getElementById(aType + "-9").hidden = true;
} else if (aType.startsWith("plugin")) {
- if (!Services.prefs.getBoolPref("plugins.click_to_play")) {
- // It is reserved for site-specific preferences only.
- document.getElementById(aType + "-0").disabled = true;
- }
pluginPermissionEntry = document.getElementById(aType + "-entry");
pluginPermissionEntry.setAttribute("vulnerable", "");
+ let vulnerable = false;
if (pluginPermissionEntry.isBlocklisted()) {
permissionMenulist.disabled = true;
permissionMenulist.setAttribute("tooltiptext",
AboutPermissions._stringBundleAboutPermissions
.GetStringFromName("pluginBlocklisted"));
+ vulnerable = true;
} else {
permissionMenulist.disabled = false;
permissionMenulist.setAttribute("tooltiptext", "");
}
+ if (Services.prefs.getBoolPref("plugins.click_to_play") || vulnerable) {
+ document.getElementById(aType + "-0").disabled = false;
+ } else {
+ document.getElementById(aType + "-0").disabled = true;
+ }
}
} else {
let _visibility = "visible";
@@ -1079,14 +1079,20 @@ var AboutPermissions = {
} else if (aType == "cookie") {
document.getElementById(aType + "-9").hidden = false;
} else if (aType.startsWith("plugin")) {
- document.getElementById(aType + "-0").disabled = false;
pluginPermissionEntry = document.getElementById(aType + "-entry");
let permString = pluginPermissionEntry.getAttribute("permString");
+ let vulnerable = false;
if (permString.startsWith("plugin-vulnerable:")) {
let nameVulnerable = " \u2014 "
+ AboutPermissions._stringBundleBrowser
.GetStringFromName("pluginActivateVulnerable.label");
pluginPermissionEntry.setAttribute("vulnerable", nameVulnerable);
+ vulnerable = true;
+ }
+ if (Services.prefs.getBoolPref("plugins.click_to_play") || vulnerable) {
+ document.getElementById(aType + "-0").disabled = false;
+ } else {
+ document.getElementById(aType + "-0").disabled = true;
}
permissionMenulist.disabled = false;
permissionMenulist.setAttribute("tooltiptext", "");
diff --git a/application/palemoon/components/permissions/aboutPermissions.xul b/application/palemoon/components/permissions/aboutPermissions.xul
index afd98247b..dfee14756 100644
--- a/application/palemoon/components/permissions/aboutPermissions.xul
+++ b/application/palemoon/components/permissions/aboutPermissions.xul
@@ -29,7 +29,7 @@
<key key="&focusSearch.key;" modifiers="accel" oncommand="AboutPermissions.focusFilterBox();"/>
</keyset>
- <hbox flex="1" id="permissions-header">
+ <hbox id="permissions-header">
<label id="permissions-pagetitle">&permissionsManager.title;</label>
</hbox>
<hbox flex="1" id="permissions-content" class="main-content">
diff --git a/application/palemoon/components/places/content/controller.js b/application/palemoon/components/places/content/controller.js
index e2ae2afb0..7f27e8347 100644
--- a/application/palemoon/components/places/content/controller.js
+++ b/application/palemoon/components/places/content/controller.js
@@ -300,9 +300,6 @@ PlacesController.prototype = {
* are non-removable. We don't need to worry about recursion here since it
* is a policy decision that a removable item not be placed inside a non-
* removable item.
- * @param aIsMoveCommand
- * True if the command for which this method is called only moves the
- * selected items to another container, false otherwise.
* @returns true if all nodes in the selection can be removed,
* false otherwise.
*/
@@ -462,8 +459,6 @@ PlacesController.prototype = {
uri = NetUtil.newURI(node.uri);
if (PlacesUtils.nodeIsBookmark(node)) {
nodeData["bookmark"] = true;
- PlacesUtils.nodeIsTagQuery(node.parent)
-
var parentNode = node.parent;
if (parentNode) {
if (PlacesUtils.nodeIsTagQuery(parentNode))
diff --git a/application/palemoon/components/preferences/applications.js b/application/palemoon/components/preferences/applications.js
index 5768de708..d06f9f9fb 100644
--- a/application/palemoon/components/preferences/applications.js
+++ b/application/palemoon/components/preferences/applications.js
@@ -8,15 +8,10 @@
//****************************************************************************//
// Constants & Enumeration Values
-/*
-#ifndef XP_MACOSX
-*/
var Cc = Components.classes;
var Ci = Components.interfaces;
var Cr = Components.results;
-/*
-#endif
-*/
+
Components.utils.import('resource://gre/modules/Services.jsm');
const TYPE_MAYBE_FEED = "application/vnd.mozilla.maybe.feed";
@@ -158,7 +153,7 @@ function isFeedType(t) {
*
* We create an instance of this wrapper for each entry we might display
* in the prefpane, and we compose the instances from various sources,
- * including navigator.plugins and the handler service.
+ * including plugins and the handler service.
*
* We don't implement all the original nsIHandlerInfo functionality,
* just the stuff that the prefpane needs.
@@ -272,7 +267,7 @@ HandlerInfoWrapper.prototype = {
// What to do with content of this type.
get preferredAction() {
// If we have an enabled plugin, then the action is to use that plugin.
- if (this.plugin && !this.isDisabledPluginType)
+ if (this.pluginName && !this.isDisabledPluginType)
return kActionUsePlugin;
// If the action is to use a helper app, but we don't have a preferred
@@ -293,6 +288,14 @@ HandlerInfoWrapper.prototype = {
},
set preferredAction(aNewValue) {
+ // If the action is to use the plugin,
+ // we must set the preferred action to "save to disk".
+ // But only if it's not currently the preferred action.
+ if ((aNewValue == kActionUsePlugin) &&
+ (this.preferredAction != Ci.nsIHandlerInfo.saveToDisk)) {
+ aNewValue = Ci.nsIHandlerInfo.saveToDisk;
+ }
+
// We don't modify the preferred action if the new action is to use a plugin
// because handler info objects don't understand our custom "use plugin"
// value. Also, leaving it untouched means that we can automatically revert
@@ -308,7 +311,7 @@ HandlerInfoWrapper.prototype = {
// of any user configuration, and the default in that case is to always ask,
// even though we never ask for content handled by a plugin, so special case
// plugin-handled types by returning false here.
- if (this.plugin && this.handledOnlyByPlugin)
+ if (this.pluginName && this.handledOnlyByPlugin)
return false;
// If this is a protocol type and the preferred action is "save to disk",
@@ -1064,24 +1067,22 @@ var gApplicationsPane = {
* check the pref ourselves to find out if it's enabled.
*/
_loadPluginHandlers: function() {
- for (let i = 0; i < navigator.plugins.length; ++i) {
- let plugin = navigator.plugins[i];
- for (let j = 0; j < plugin.length; ++j) {
- let type = plugin[j].type;
-
- let handlerInfoWrapper;
- if (type in this._handledTypes)
- handlerInfoWrapper = this._handledTypes[type];
- else {
- let wrappedHandlerInfo =
- this._mimeSvc.getFromTypeAndExtension(type, null);
- handlerInfoWrapper = new HandlerInfoWrapper(type, wrappedHandlerInfo);
- handlerInfoWrapper.handledOnlyByPlugin = true;
- this._handledTypes[type] = handlerInfoWrapper;
- }
+ "use strict";
- handlerInfoWrapper.plugin = plugin;
+ let mimeTypes = navigator.mimeTypes;
+
+ for (let mimeType of mimeTypes) {
+ let handlerInfoWrapper;
+ if (mimeType.type in this._handledTypes) {
+ handlerInfoWrapper = this._handledTypes[mimeType.type];
+ } else {
+ let wrappedHandlerInfo =
+ this._mimeSvc.getFromTypeAndExtension(mimeType.type, null);
+ handlerInfoWrapper = new HandlerInfoWrapper(mimeType.type, wrappedHandlerInfo);
+ handlerInfoWrapper.handledOnlyByPlugin = true;
+ this._handledTypes[mimeType.type] = handlerInfoWrapper;
}
+ handlerInfoWrapper.pluginName = mimeType.enabledPlugin.name;
}
},
@@ -1274,7 +1275,7 @@ var gApplicationsPane = {
case kActionUsePlugin:
return this._prefsBundle.getFormattedString("usePluginIn",
- [aHandlerInfo.plugin.name,
+ [aHandlerInfo.pluginName,
this._brandShortName]);
}
},
@@ -1368,7 +1369,7 @@ var gApplicationsPane = {
{
var askMenuItem = document.createElement("menuitem");
- askMenuItem.setAttribute("alwaysAsk", "true");
+ askMenuItem.setAttribute("action", Ci.nsIHandlerInfo.alwaysAsk);
let label;
if (isFeedType(handlerInfo.type))
label = this._prefsBundle.getFormattedString("previewInApp",
@@ -1456,11 +1457,11 @@ var gApplicationsPane = {
}
// Create a menu item for the plugin.
- if (handlerInfo.plugin) {
+ if (handlerInfo.pluginName) {
var pluginMenuItem = document.createElement("menuitem");
pluginMenuItem.setAttribute("action", kActionUsePlugin);
let label = this._prefsBundle.getFormattedString("usePluginIn",
- [handlerInfo.plugin.name,
+ [handlerInfo.pluginName,
this._brandShortName]);
pluginMenuItem.setAttribute("label", label);
pluginMenuItem.setAttribute("tooltiptext", label);
@@ -1614,33 +1615,31 @@ var gApplicationsPane = {
var typeItem = this._list.selectedItem;
var handlerInfo = this._handledTypes[typeItem.type];
- if (aActionItem.hasAttribute("alwaysAsk")) {
+ let action = parseInt(aActionItem.getAttribute("action"));
+
+ // Set the plugin state if we're enabling or disabling a plugin.
+ if (action == kActionUsePlugin)
+ handlerInfo.enablePluginType();
+ else if (handlerInfo.pluginName && !handlerInfo.isDisabledPluginType)
+ handlerInfo.disablePluginType();
+
+ // Set the preferred application handler.
+ // We leave the existing preferred app in the list when we set
+ // the preferred action to something other than useHelperApp so that
+ // legacy datastores that don't have the preferred app in the list
+ // of possible apps still include the preferred app in the list of apps
+ // the user can choose to handle the type.
+ if (action == Ci.nsIHandlerInfo.useHelperApp)
+ handlerInfo.preferredApplicationHandler = aActionItem.handlerApp;
+
+ // Set the "always ask" flag.
+ if (action == Ci.nsIHandlerInfo.alwaysAsk)
handlerInfo.alwaysAskBeforeHandling = true;
- }
- else if (aActionItem.hasAttribute("action")) {
- let action = parseInt(aActionItem.getAttribute("action"));
-
- // Set the plugin state if we're enabling or disabling a plugin.
- if (action == kActionUsePlugin)
- handlerInfo.enablePluginType();
- else if (handlerInfo.plugin && !handlerInfo.isDisabledPluginType)
- handlerInfo.disablePluginType();
-
- // Set the preferred application handler.
- // We leave the existing preferred app in the list when we set
- // the preferred action to something other than useHelperApp so that
- // legacy datastores that don't have the preferred app in the list
- // of possible apps still include the preferred app in the list of apps
- // the user can choose to handle the type.
- if (action == Ci.nsIHandlerInfo.useHelperApp)
- handlerInfo.preferredApplicationHandler = aActionItem.handlerApp;
-
- // Set the "always ask" flag.
+ else
handlerInfo.alwaysAskBeforeHandling = false;
- // Set the preferred action.
- handlerInfo.preferredAction = action;
- }
+ // Set the preferred action.
+ handlerInfo.preferredAction = action;
handlerInfo.store();