-
Enter content in the navigation bar, and the browser process determines whether the content complies with the URL rules. If so, the URL is added with the appropriate protocol, for example; If it does not, it is treated as a search keyword and the browser’s default search is enabled to generate a new URL.
-
After the user has entered and entered in the navigation bar, the browser gives the current page an opportunity to perform a beforeUnload event before it is replaced with a new page. Beforeunload events can cancel navigation.
-
The browser Process sends the URL to the network Process through IPC (Inter-process Communication). After receiving the URL, the network Process initiates the real request. The network process checks whether there are cached resources locally. If there are cached resources, the network process can directly return the cached resources to the browser process. If there is no cache, then the network request flow is entered. The first step before the request is to perform DNS resolution to obtain the IP address of the DNS server. If the request protocol is HTTPS, you also need to establish a TLS (Secure Transport Layer Protocol) connection. Next, the TCP connection is established using the IP address. After the connection is established, the browser side will build the request header, request line and other information, and the Cookie and other data related to the domain name will be attached to the request header, and then send the constructed request information to the server.
-
After receiving the request information, the server will generate response data (including response line, response header, response body and other information) according to the request information and send it to the network process. After the network process receives the response data, it starts parsing the response information.
-
redirect
When a network process parses the response data and gets a return code of 301 or 302 in the response header, the server requires the browser to redirect to another URL. The network process takes the value of the Location field in the response header, which is the new URL, and then makes an HTTP or HTTPS request, starting from scratch.
-
Response data type processing
The browser determines what to do with the Content of the response body based on the value of the Content-Type field in the response header. If it is of a download type, the request is submitted to the browser’s download manager and the navigation of the URL request ends. In the case of HTML, the browser continues with the navigation process.
-
-
Next comes the rendering process preparation, and typically, a separate rendering process is used for each page. Unless A and B belong to the same site (), A opens B, and B’s page is reused by A’s rendering process.
-
Once the rendering process is ready, it is time to submit the document. Submitting a document means that the browser process submits the HTML data received by the web process to the renderer process as follows:
- First, when the browser process receives the response header data from the web process, it sends a “submit document” message to the renderer process.
- When the renderer receives the “submit document” message, it sets up a “pipeline” with the network process to transfer data.
- When the document data transfer is complete, the renderer process returns a “confirm submission” message to inform the browser process.
- After receiving the “submit Confirmation” message, the browser process updates the browser interface status, including the security status, URL in the address bar, historical status of forward and backward, and the Web page.
At this point, a complete navigation process is “gone”, and the rendering phase begins.
-
Once the document is submitted, the renderer process begins page parsing and child resource loading. Once the page is generated, the renderer sends a message to the browser process, which receives the message and stops the loading animation on the label icon.