Improve Firefox capability. Add browser detection. Refine global variable names