Need how-to for signature creation

Hi, I want to add a JS-created image with data-uri to the editor nodes,
each time, when the message composer window is being opened.

I know how to create the image, but I do not know, where to register my java function…

window.addEventListener("composer-window-reopen")

does not work

thunderbird 60.4.0

Thanks