just do 'new MainContentObserver()' in the function, and do "delete this" in its callback. btw maybe it's better to rename it to something more descriptive like CloseAfterLoadObserver?