support multiple browsers (in a very hacky way