Fx60: Add-on window changes

Legacy/unsigned add-on warnings are now hidden via CSS in the Firefox
build, so remove the code that tries to do that, and instead add a class
to any other warnings so they can be selectively shown.
This commit is contained in:
Dan Stillman 2019-08-23 03:18:35 -04:00
parent 732bb23c33
commit c5d404df5e

View file

@ -446,14 +446,11 @@ const ZoteroStandalone = new function() {
this.updateAddonsPane = function (doc) { this.updateAddonsPane = function (doc) {
// Hide unsigned add-on verification warnings // Unsigned add-on warnings are hidden by default in extensions.css (via style rules added
// // by fetch_xulrunner.sh), but allow other warnings
// This only works for the initial load of the window. If the user switches to Appearance function updateExtensions () {
// or Plugins and then back to Extensions, the warnings will appear again. A better way to var addonList = doc.getElementById('addon-list');
// disable this might be discoverable by studying
// https://dxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/content/extensions.js
var addonList = doc.getElementById('addon-list');
setTimeout(function () {
for (let i = 0; i < addonList.itemCount; i++) { for (let i = 0; i < addonList.itemCount; i++) {
let richListItem = addonList.getItemAtIndex(i); let richListItem = addonList.getItemAtIndex(i);
let container = doc.getAnonymousElementByAttribute( let container = doc.getAnonymousElementByAttribute(
@ -463,13 +460,16 @@ const ZoteroStandalone = new function() {
let link = doc.getAnonymousElementByAttribute( let link = doc.getAnonymousElementByAttribute(
richListItem, 'anonid', 'warning-link' richListItem, 'anonid', 'warning-link'
); );
if (link && link.href.indexOf('unsigned-addons') != -1) { if (link) {
richListItem.removeAttribute('notification'); if (!link.href.includes('unsigned-addons')) {
container.hidden = true; container.classList.add('allowed-warning');
}
} }
} }
} }
}); }
doc.getElementById('category-extension').onclick = updateExtensions;
setTimeout(updateExtensions);
} }
/** /**