use events instead

https://developer.mozilla.org/en-US/docs/XUL/School_tutorial/Adding_Events_and_Commands#Custom_events