bumpy-pilot-80789
09/04/2022, 6:08 PMgorgeous-ghost-95789
09/04/2022, 6:09 PMHX-Trigger:form2mail and then window.addEventListener('form2mail', function() {...})bumpy-pilot-80789
09/04/2022, 6:09 PMjavascript
addEventListener("form2mail", function (_e) { ... });bumpy-pilot-80789
09/04/2022, 6:09 PMgorgeous-ghost-95789
09/04/2022, 6:10 PMbumpy-pilot-80789
09/04/2022, 6:10 PMbumpy-pilot-80789
09/04/2022, 6:10 PMbumpy-pilot-80789
09/04/2022, 6:11 PMjavascript
window.dispatchEvent(new Event('form2mail'))
from my browser's console simply works)gorgeous-ghost-95789
09/04/2022, 6:11 PMbumpy-pilot-80789
09/04/2022, 6:11 PMgorgeous-ghost-95789
09/04/2022, 6:13 PMaddEventListener might default to working with the document, not the window Can you try prefixing your code with window.addEventListener() instead of just saying addEventListener()?bumpy-pilot-80789
09/04/2022, 6:15 PMgorgeous-ghost-95789
09/04/2022, 6:16 PMbumpy-pilot-80789
09/04/2022, 6:16 PMwindow.addEventListener ought to be the same as simpy addEventListenergorgeous-ghost-95789
09/04/2022, 6:17 PMHX-Trigger header showing up in the browser's dev tools in the response to your HTTP Post?bumpy-pilot-80789
09/04/2022, 6:17 PMgorgeous-ghost-95789
09/04/2022, 6:18 PMgorgeous-ghost-95789
09/04/2022, 6:18 PMbumpy-pilot-80789
09/04/2022, 6:19 PMgorgeous-ghost-95789
09/04/2022, 6:20 PMgorgeous-ghost-95789
09/04/2022, 6:20 PMbumpy-pilot-80789
09/04/2022, 6:20 PMgorgeous-ghost-95789
09/04/2022, 6:22 PMbumpy-pilot-80789
09/04/2022, 6:22 PMgorgeous-ghost-95789
09/04/2022, 6:23 PMbumpy-pilot-80789
09/04/2022, 6:23 PMbumpy-pilot-80789
09/04/2022, 6:23 PMbumpy-pilot-80789
09/04/2022, 6:23 PMgorgeous-ghost-95789
09/04/2022, 6:24 PMgorgeous-ghost-95789
09/04/2022, 6:25 PM