Completed code changes to fix the bug of 'this.mozJSPref is undefined'