MCPcopy
hub / github.com/mailvelope/mailvelope / scanDOM

Function scanDOM

src/content-scripts/main.js:147–168  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

145}
146
147function scanDOM() {
148 // find armored PGP text
149 try {
150 const pgpRanges = findPGPRanges();
151 if (pgpRanges.length) {
152 attachExtractFrame(pgpRanges);
153 }
154 } catch (e) {
155 console.log('Detecting PGP messages failed: ', e);
156 }
157 if (currentProvider?.integration) {
158 return;
159 }
160 try {
161 const editables = findEditable();
162 if (editables.length !== 0) {
163 attachEncryptFrame(editables);
164 }
165 } catch (e) {
166 console.log('Detecting editor elements failed: ', e);
167 }
168}
169
170/**
171 * Check the nodes text content for PGP_HEADER and PGP_FOOTER

Callers 2

nextFunction · 0.85
onFunction · 0.85

Calls 4

findPGPRangesFunction · 0.85
attachExtractFrameFunction · 0.85
findEditableFunction · 0.85
attachEncryptFrameFunction · 0.85

Tested by

no test coverage detected