diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-07-17 11:32:58 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-07-17 11:32:58 +0200 |
commit | f3dc7095e6e4a43356c44e6d3c263e804593e0ab (patch) | |
tree | cde6e0cbb43f7901e27a1a7a3fafa6a5ce760874 /application/palemoon/base/content | |
parent | 57e08f8dd67870662c2021fd7603a966bed44343 (diff) | |
download | UXP-f3dc7095e6e4a43356c44e6d3c263e804593e0ab.tar UXP-f3dc7095e6e4a43356c44e6d3c263e804593e0ab.tar.gz UXP-f3dc7095e6e4a43356c44e6d3c263e804593e0ab.tar.lz UXP-f3dc7095e6e4a43356c44e6d3c263e804593e0ab.tar.xz UXP-f3dc7095e6e4a43356c44e6d3c263e804593e0ab.zip |
[PALEMOON] Fix Page Info - permissions (plugins.click_to_play / vulnerable plugins)
Diffstat (limited to 'application/palemoon/base/content')
-rw-r--r-- | application/palemoon/base/content/pageinfo/permissions.js | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/application/palemoon/base/content/pageinfo/permissions.js b/application/palemoon/base/content/pageinfo/permissions.js index 5d25a800d..4f8382f66 100644 --- a/application/palemoon/base/content/pageinfo/permissions.js +++ b/application/palemoon/base/content/pageinfo/permissions.js @@ -217,14 +217,20 @@ function fillInPluginPermissionTemplate(aPermissionString, aPluginObject) { .cloneNode(true); permPluginTemplate.setAttribute("permString", aPermissionString); permPluginTemplate.setAttribute("tooltiptext", aPluginObject.description); - let attrs = [ - [ ".permPluginTemplateLabel", "value", aPluginObject.name ], - [ ".permPluginTemplateRadioGroup", "id", aPermissionString + "RadioGroup" ], - [ ".permPluginTemplateRadioDefault", "id", aPermissionString + "#0" ], - [ ".permPluginTemplateRadioAsk", "id", aPermissionString + "#3" ], - [ ".permPluginTemplateRadioAllow", "id", aPermissionString + "#1" ], - [ ".permPluginTemplateRadioBlock", "id", aPermissionString + "#2" ] - ]; + let attrs = []; + attrs.push([".permPluginTemplateLabel", "value", aPluginObject.name]); + attrs.push([".permPluginTemplateRadioGroup", "id", aPermissionString + "RadioGroup"]); + attrs.push([".permPluginTemplateRadioDefault", "id", aPermissionString + "#0"]); + let permPluginTemplateRadioAsk = ".permPluginTemplateRadioAsk"; + if (Services.prefs.getBoolPref("plugins.click_to_play") || + aPluginObject.vulnerable) { + attrs.push([permPluginTemplateRadioAsk, "id", aPermissionString + "#3"]); + } else { + permPluginTemplate.querySelector(permPluginTemplateRadioAsk) + .setAttribute("disabled", "true"); + } + attrs.push([".permPluginTemplateRadioAllow", "id", aPermissionString + "#1"]); + attrs.push([".permPluginTemplateRadioBlock", "id", aPermissionString + "#2"]); for (let attr of attrs) { permPluginTemplate.querySelector(attr[0]).setAttribute(attr[1], attr[2]); @@ -264,13 +270,16 @@ function initPluginsRow() { } let permString = pluginHost.getPermissionStringForType(mimeType); if (!permissionMap.has(permString)) { - var name = makeNicePluginName(plugin.name) + " " + plugin.version; + let name = makeNicePluginName(plugin.name) + " " + plugin.version; + let vulnerable = false; if (permString.startsWith("plugin-vulnerable:")) { name += " \u2014 " + vulnerableLabel; + vulnerable = true; } permissionMap.set(permString, { "name": name, "description": plugin.description, + "vulnerable": vulnerable }); } } |