if you disable javascript gmail will give you a warning about your browser not supporting it and ask you if you want to use it with basic html or something to that extent, so you won't be logged in the chat.
on firefox you can disable it under content under tools > options. disabling it is also useful when sites try to block you from saving their images.