From df0c950a52d9f2916e4d18b5ffa9ab4bacb08dd9 Mon Sep 17 00:00:00 2001 From: Andy Date: Sat, 27 Feb 2021 00:53:59 -0800 Subject: [PATCH] Support Modern SeaMonkey --- README.md | 2 +- chrome/content/binding.xml | 6 ++++++ chrome/content/controller.js | 22 +++++++++++++++++++--- install.rdf | 2 +- 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c7642af..2cef138 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Export your extensions! #### Supports * Pale Moon [25.0a1pre - 29.*] * Firefox [3.0 - 50.*] - * SeaMonkey [2.0a1 - 2.40] + * SeaMonkey [2.0a1 - 2.*] * Thunderbird [2.0 - 52.*] * Sunbird [1.0b1 - 5.0b2pre] diff --git a/chrome/content/binding.xml b/chrome/content/binding.xml index e4066ed..ff77b46 100644 --- a/chrome/content/binding.xml +++ b/chrome/content/binding.xml @@ -169,6 +169,12 @@ } } } + else if (this.parentNode.parentNode.parentNode.parentNode.tagName.toLowerCase() === 'richlistitem') + { + extName = this.parentNode.parentNode.parentNode.parentNode.getAttribute('name'); + extID = this.parentNode.parentNode.parentNode.parentNode.value; + extVer = this.parentNode.parentNode.parentNode.parentNode.mAddon.version; + } else { extName = this.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.getAttribute('name'); diff --git a/chrome/content/controller.js b/chrome/content/controller.js index c1dddf5..e906e37 100644 --- a/chrome/content/controller.js +++ b/chrome/content/controller.js @@ -45,7 +45,14 @@ var ExtExp = { var existings; var cb; - if (document.getElementById('view-port').selectedPanel.id == 'list-view') + var viewBox = null; + if (document.getElementById('headered-views-content') !== null) + viewBox = document.getElementById('headered-views-content'); + else if (document.getElementById('view-port') !== null) + viewBox = document.getElementById('view-port'); + if (viewBox === null) + return; + if (viewBox.selectedPanel.id == 'list-view') { for (var i=0; i < document.getElementById('addon-list').itemCount; i++) { @@ -77,7 +84,7 @@ var ExtExp = } document.getElementById('addon-list').addEventListener('select', ExtExp.newButton, false); } - else if (document.getElementById('view-port').selectedPanel.id == 'detail-view') + else if (viewBox.selectedPanel.id == 'detail-view') { var detail = document.getElementById('detail-view'); existings = detail.getElementsByTagName('extExpExportButton'); @@ -110,7 +117,14 @@ var ExtExp = }, newButton: function() { - if (document.getElementById('view-port').selectedPanel.id == 'list-view') + var viewBox = null; + if (document.getElementById('headered-views-content') !== null) + viewBox = document.getElementById('headered-views-content'); + else if (document.getElementById('view-port') !== null) + viewBox = document.getElementById('view-port'); + if (viewBox === null) + return; + if (viewBox.selectedPanel.id == 'list-view') { for (var i = 0; i < document.getElementById('addon-list').itemCount; i++) { @@ -326,6 +340,8 @@ var ExtExp = var extVer = '0.0'; if (typeof child._version !== 'undefined' && child._version !== null && child._version.hasAttribute('value')) extVer = child._version.getAttribute('value'); + if (typeof child.mAddon !== undefined && child.mAddon.version !== null) + extVer = child.mAddon.version; var ext = {name: extName, version: extVer, id: extID, path: extPath}; expList.push(ext); } diff --git a/install.rdf b/install.rdf index faa6f77..f8fa53c 100644 --- a/install.rdf +++ b/install.rdf @@ -18,7 +18,7 @@ {92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a} 2.0a1 - 2.40 + 2.*