diff --git a/signature-extension/background.js b/signature-extension/background.js
index 14ac54c..43a3a8f 100644
--- a/signature-extension/background.js
+++ b/signature-extension/background.js
@@ -28,7 +28,8 @@ async function syncAccounts() {
try {
let signature = await getUserSignature(syncable);
let account = await browser.accounts.get(account_id);
- await browser.signatureApi.setSignatureHTML(account.identities[0].id, signature);
+ let identity = {signature: signature, signatureIsPlainText: false};
+ await browser.identities.update(account.identities[0].id, identity);
syncable.lastSync = new Date();
syncable.lastError = null;
} catch (error) {
diff --git a/signature-extension/changelog.html b/signature-extension/changelog.html
index 204e244..4efb5b1 100644
--- a/signature-extension/changelog.html
+++ b/signature-extension/changelog.html
@@ -15,6 +15,14 @@
Welcome in the new version of Signature sync for Gmail!
only on first use and major changes, but you can always access it in add-on's preferences.
+ Version 2.1.0
+
+ -
+ Moving into official identity API in Thunderbid, as so the extension doesn't need the full
+ permissions anymore. Requires Thunderbird 91 or newer.
+
+
+
Version 2.0.0
-
diff --git a/signature-extension/implementation.js b/signature-extension/implementation.js
deleted file mode 100644
index 4bf8f78..0000000
--- a/signature-extension/implementation.js
+++ /dev/null
@@ -1,23 +0,0 @@
-var { ExtensionCommon } = ChromeUtils.import("resource://gre/modules/ExtensionCommon.jsm");
-var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-
-var signatureApi = class extends ExtensionCommon.ExtensionAPI {
- getAPI(context) {
- return {
- signatureApi: {
- getSignature: async function (identityId) {
- let signature = await Services.prefs.getStringPref(
- `mail.identity.${identityId}.htmlSigText`,
- null
- );
- return signature;
- },
-
- setSignatureHTML: async function (identityId, signature) {
- Services.prefs.setStringPref(`mail.identity.${identityId}.htmlSigText`, signature);
- Services.prefs.setBoolPref(`mail.identity.${identityId}.htmlSigFormat`, true);
- },
- },
- };
- }
-};
diff --git a/signature-extension/manifest.json b/signature-extension/manifest.json
index 1d87f3c..2cb0611 100644
--- a/signature-extension/manifest.json
+++ b/signature-extension/manifest.json
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Signature sync for Gmail",
- "version": "2.0.2",
+ "version": "2.1.0",
"author": "Kamil MaĆkowski",
"description": "Sync your signatures with Gmail accounts",
"homepage_url": "https://thbrd-signature.kam193.eu/",
@@ -11,7 +11,7 @@
"applications": {
"gecko": {
"id": "signature-sync@thunderbird.extensions.kam193",
- "strict_min_version": "78.4.0"
+ "strict_min_version": "91.0"
}
},
"background": {
@@ -21,6 +21,7 @@
"accountsRead",
"identity",
"storage",
+ "accountsIdentities",
"*://www.googleapis.com/*",
"*://oauth2.googleapis.com/*"
],
@@ -28,15 +29,5 @@
"page": "options.html",
"open_in_tab": false,
"browser_style": true
- },
- "experiment_apis": {
- "signatureApi": {
- "schema": "schema.json",
- "parent": {
- "scopes": ["addon_parent"],
- "paths": [["signatureApi"]],
- "script": "implementation.js"
- }
- }
}
}
diff --git a/signature-extension/schema.json b/signature-extension/schema.json
deleted file mode 100644
index ee76bfa..0000000
--- a/signature-extension/schema.json
+++ /dev/null
@@ -1,38 +0,0 @@
-[
- {
- "namespace": "signatureApi",
- "functions": [
- {
- "name": "getSignature",
- "type": "function",
- "description": "Get signature value or null",
- "async": true,
- "parameters": [
- {
- "name": "identityId",
- "type": "string",
- "description": "ID of identity tu update"
- }
- ]
- },
- {
- "name": "setSignatureHTML",
- "type": "function",
- "description": "Set and enable HTML signature",
- "async": true,
- "parameters": [
- {
- "name": "identityId",
- "type": "string",
- "description": "ID of identity tu update"
- },
- {
- "name": "signature",
- "type": "string",
- "description": "A string of signature (HTML)"
- }
- ]
- }
- ]
- }
-]