how a extension works after mozilla runs?

how a extension works after mozilla runs?


hi,
i try to get an extension which remembers the last choice and
according to it works automaticly for a new tab or a new window (after
all windows closes)..
i use XUL to create a button and a window.. using them the extention
works for current tabs, but i could not achive it works without a
button..
I hope you have some hints about my problem, thanks..