diff --git a/js/mzta-compose-script.js b/js/mzta-compose-script.js index b5bdbdd6..05c958b6 100644 --- a/js/mzta-compose-script.js +++ b/js/mzta-compose-script.js @@ -55,6 +55,9 @@ switch (message.command) { case "getTextOnly": return Promise.resolve(window.document.body.innerText); + case "getFullHtml": + return Promise.resolve(window.document.body.innerHTML); + case 'promptTooLong': alert(browser.i18n.getMessage('msg_prompt_too_long')); return Promise.resolve(true); diff --git a/js/mzta-menus.js b/js/mzta-menus.js index bb7793ba..de17a0dc 100644 --- a/js/mzta-menus.js +++ b/js/mzta-menus.js @@ -78,7 +78,8 @@ export class mzta_Menus { //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" }) + text: await browser.tabs.sendMessage(tabs[0].id, { command: "getTextOnly" }), + html: await browser.tabs.sendMessage(tabs[0].id, { command: "getFullHtml" }), }; }; @@ -130,6 +131,9 @@ export class mzta_Menus { case 'mail_body': finalSubs['mail_body'] = body_text; break; + case 'html_body': console.log(">>>>>>>>>> html_body: " + msg_text.html); + finalSubs['html_body'] = msg_text.html; + break; case 'mail_subject': finalSubs['mail_subject'] = mail_subject; break;