when does Windows Hosts file redirection take place

In regards to a browser http request life cycle, before the actual execution of sending the request, at what point does the, so to speak, “DNS” of the windows hosts file take place? After entering a site address into any web browser, when you hit enter, is one of the first things that takes place a check to the hosts file? or perhaps one of the last? Would a javascript chrome extension or firefox add-on be able to override what is in the hosts file at all? Is the point of execution browser dependant?