From 3fb0bd6572d25667a985e41be3a48a37e1488e65 Mon Sep 17 00:00:00 2001 From: mic Date: Wed, 15 Jan 2025 22:01:19 +0100 Subject: [PATCH] sending autoselect when using the mail_typed_text placeholder. see #229 --- js/mzta-menus.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/mzta-menus.js b/js/mzta-menus.js index 1c62bdec..4c28194a 100644 --- a/js/mzta-menus.js +++ b/js/mzta-menus.js @@ -76,19 +76,19 @@ export class mzta_Menus { let curr_menu_entry = {id: curr_prompt.id, is_default: curr_prompt.is_default, name: curr_prompt.name}; let curr_message = null; - const getMailBody = async (tabs) => { + const getMailBody = async (tabs, do_autoselect = false) => { //const tabs = await browser.tabs.query({ active: true, currentWindow: true }); return {tabId: tabs[0].id, selection: await browser.tabs.sendMessage(tabs[0].id, { command: "getSelectedText" }), text: await browser.tabs.sendMessage(tabs[0].id, { command: "getTextOnly" }), html: await browser.tabs.sendMessage(tabs[0].id, { command: "getFullHtml" }), - only_typed_text: await browser.tabs.sendMessage(tabs[0].id, { command: "getOnlyTypedText" }) + only_typed_text: await browser.tabs.sendMessage(tabs[0].id, { command: "getOnlyTypedText", do_autoselect: do_autoselect }) }; }; curr_menu_entry.act = async () => { const tabs = await browser.tabs.query({ active: true, currentWindow: true }); - const msg_text = await getMailBody(tabs); + const msg_text = await getMailBody(tabs, placeholdersUtils.hasPlaceholder(curr_prompt.text,'mail_typed_text')); //check if a selection is needed if(String(curr_prompt.need_selected) == "1" && (msg_text.selection==='')){