Framescript unload event?

Is there anyway to add an unload event listener to my framescript? I want to know what it’s destoryed so it can send out one last message.

If your framescript is attached with an sdk worker then you can listen to "detach" on self.port.

Thanks Martin! Actually Im not using sdk I am using loadFrameScript :frowning: