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

Method setRecipients

src/content-scripts/providerSpecific.js:100–121  ·  view source on GitHub ↗

* Set the recipients in the Gmail Webmail editor.

({recipients = [], editElement})

Source from the content-addressed store, hash-verified

98 * Set the recipients in the Gmail Webmail editor.
99 */
100 setRecipients({recipients = [], editElement}) {
101 const containerElement = editElement.closest('.I5');
102 // find the relevant elements in the Gmail interface
103 const displayArea = containerElement.querySelector('.aoD.hl'); // email display only area
104 const tagRemove = containerElement.querySelectorAll('.afV[data-hovercard-id] .afX'); // email tags remove button
105 const input = containerElement.querySelectorAll('.agP.aFw'); // the actual recipient email address text input (a textarea)
106 const subject = containerElement.querySelector('.aoT'); // subject field
107 const editor = containerElement.querySelector('.Am.Al'); // editor
108 input.forEach(element => element.value = '');
109 setFocus(displayArea)
110 .then(() => {
111 tagRemove.forEach(tag => tag.click());
112 // enter address text into input
113 const text = joinEmail(recipients);
114 if (input.length) {
115 input.item(0).value = text;
116 }
117 })
118 .then(() => {
119 setFocus(isVisible(subject) ? subject : editor);
120 });
121 }
122
123 /**
124 * Extract sender

Callers 3

setEditorOutputMethod · 0.45

Calls 3

isVisibleFunction · 0.90
setFocusFunction · 0.85
joinEmailFunction · 0.85

Tested by

no test coverage detected