Use local variable rather than global const for loader
Use nsIPromptService.alert() instead of window.alert()