Skip to content

Code at Top of Email

edited November 17 in Troubleshooting

When creating an email for any list of any type of autoresponder or even any type of email (be it html, or plain text), Sendy is adding:

`; let parser = new DOMParser(); let xmlDoc; if (mimeType.useXMLparser === true) { xmlDoc = parser.parseFromString(args[0].join(''), mimeType.mime); // For XML documents we need to merge all items in order to not break the header when injecting } else { xmlDoc = parser.parseFromString(args[0][0], mimeType.mime); } if (xmlDoc.getElementsByTagName("parsererror").length === 0) { // if no errors were found while parsing... xmlDoc.documentElement.insertAdjacentHTML('afterbegin', injectedCode); if (mimeType.useXMLparser === true) { args[0] = [new XMLSerializer().serializeToString(xmlDoc)]; } else { args[0][0] = xmlDoc.documentElement.outerHTML; } } } } return instantiate(_Blob, args); // arguments? } // Copy props and methods let propNames = Object.getOwnPropertyNames(_Blob); for (let i = 0; i < propNames.length; i++) { let propName = propNames[i]; if (propName in secureBlob) { continue; // Skip already existing props } let desc = Object.getOwnPropertyDescriptor(_Blob, propName); Object.defineProperty(secureBlob, propName, desc); } secureBlob.prototype = _Blob.prototype; return secureBlob; }(Blob); window.addEventListener('message', function (event) { if (event.source !== window) { return; } const message =; switch (message.method) { case 'updateLocation': if ((typeof === 'object') && (typeof === 'object')) { hookedObj.genLat =; hookedObj.genLon =; hookedObj.fakeGeo =; } break; default: break; } }, false); //]]> }hookGeo();})()

At the top of the email.

How do we fix that?


  • Hi,

    One of your browser extension is inserting code into the WYSIWYG editor when you were editing your email campaign (for example, ‘Grammarly’, ‘Ad Blocker Ultimate’, 'Adguard Adblocker', ‘MetaMask‘, 'Microsoft Editor' browser extensions are known to do just that).

    1. Disable all extensions in your browser (you may try this convenient plugin) as one of your browser extensions is inserting redundant code into the WYSIWYG editor when you’re creating or editing a campaign
    2. Or use a browser that has no extensions installed
    3. Then re-create your campaign (not just “Duplicate”, create a new campaign and write your message)

    If the weird code no longer appears in your email, then you’d need to track down this browser extension that inserts code into the WYSIWYG editor when you were creating/editing your campaign and disable it.


    Best regards,

This discussion has been closed.