MCPcopy Index your code
hub / github.com/mailvelope/mailvelope / showMailEditor

Method showMailEditor

src/content-scripts/encryptFrame.js:132–146  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

130 }
131
132 async showMailEditor() {
133 const options = {};
134 const emailContent = this.getEmailText(this.editorType == PLAIN_TEXT ? 'text' : 'html');
135 if (/BEGIN\sPGP\sMESSAGE/.test(emailContent)) {
136 try {
137 options.quotedMail = normalizeArmored(emailContent, /-----BEGIN PGP MESSAGE-----[\s\S]+?-----END PGP MESSAGE-----/);
138 } catch (e) {
139 options.text = emailContent;
140 }
141 } else {
142 options.text = emailContent;
143 }
144 options.recipients = await this.currentProvider.getRecipients(this.editElement);
145 this.port.emit('eframe-display-editor', options);
146 }
147
148 getEmailText(type) {
149 let text;

Callers 2

onEditorButtonMethod · 0.95

Calls 4

getEmailTextMethod · 0.95
normalizeArmoredFunction · 0.90
getRecipientsMethod · 0.45
emitMethod · 0.45

Tested by

no test coverage detected