Handle preview pane when loading details

This commit is contained in:
Jordan Wages 2025-07-05 04:33:01 -05:00
commit 41769c0e96
3 changed files with 9 additions and 1 deletions

View file

@ -113,6 +113,7 @@ Sortana requests the following Thunderbird permissions:
- `messagesTagsList` retrieve existing message tags for rule actions. - `messagesTagsList` retrieve existing message tags for rule actions.
- `accountsRead` list accounts and folders for move actions. - `accountsRead` list accounts and folders for move actions.
- `menus` add context menu commands. - `menus` add context menu commands.
- `tabs` open new tabs and query the active tab.
## Thunderbird Add-on Store Disclosures ## Thunderbird Add-on Store Disclosures

View file

@ -8,6 +8,12 @@ document.addEventListener('DOMContentLoaded', async () => {
const tabId = tabs[0]?.id; const tabId = tabs[0]?.id;
const msgs = tabId ? await browser.messageDisplay.getDisplayedMessages(tabId) : []; const msgs = tabId ? await browser.messageDisplay.getDisplayedMessages(tabId) : [];
id = msgs[0]?.id; id = msgs[0]?.id;
if (!id) {
const mailTabs = await browser.mailTabs.query({ active: true, currentWindow: true });
const mailTabId = mailTabs[0]?.id;
const selected = mailTabId !== undefined ? await browser.mailTabs.getSelectedMessages(mailTabId) : null;
id = selected?.messages?.[0]?.id;
}
} catch (e) { } catch (e) {
console.error('failed to determine message id', e); console.error('failed to determine message id', e);
} }

View file

@ -40,6 +40,7 @@
"messagesTagsList", "messagesTagsList",
"accountsRead", "accountsRead",
"menus", "menus",
"scripting" "scripting",
"tabs"
] ]
} }