diff options
author | Moonchild <mcwerewolf@gmail.com> | 2018-07-17 12:18:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-17 12:18:37 +0200 |
commit | cdb690f0a35598cec49f1ebd9e6e3a0b8c220275 (patch) | |
tree | 9729598c78ef8d2b512d200f834f541e1e241196 /application/palemoon/base/content/pageinfo/permissions.js | |
parent | 8eb01c2ce4960a6a908bb2efdd48f141bf548c92 (diff) | |
parent | 70f5da857c70ffbd8282b9863b91204cd5c3c5ca (diff) | |
download | UXP-cdb690f0a35598cec49f1ebd9e6e3a0b8c220275.tar UXP-cdb690f0a35598cec49f1ebd9e6e3a0b8c220275.tar.gz UXP-cdb690f0a35598cec49f1ebd9e6e3a0b8c220275.tar.lz UXP-cdb690f0a35598cec49f1ebd9e6e3a0b8c220275.tar.xz UXP-cdb690f0a35598cec49f1ebd9e6e3a0b8c220275.zip |
Merge pull request #643 from janekptacijarabaci/pm_permissions_plugins_clickToPlay_vulnerable_1
Fix permissions plugins click to play UI
Diffstat (limited to 'application/palemoon/base/content/pageinfo/permissions.js')
-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 }); } } |