当前位置:网站首页>From input URL to page presentation
From input URL to page presentation
2022-07-25 03:07:00 【Gary_ Leong】
From input URL Show to page , What happened? ?

The whole process needs the cooperation between various processes :
- The browser process is mainly responsible for user interaction 、 Subprocess management and file storage .
- Network process provides network download function for rendering process and browser process .
- The main responsibility of the rendering process is to download HTML、JavaScript、CSS、 Pictures and other resources are parsed into pages that can be displayed and interacted . Because all the content of the rendering process is obtained through the network , There will be some malicious code using browser vulnerabilities to attack the system , So the code running in the rendering process is not trusted . That's why Chrome Will make the rendering process run in a safe sandbox , Just to ensure the safety of the system .
From input URL The process of page display can be roughly described as follows :
- Users from the browser process Enter the request information ;
- Network process launch URL request ;
- Server response URL After the request , The browser process starts Prepare the rendering process ;
- When the rendering process is ready , You need to submit the page data to the rendering process first , be called Submit documents Stage ;
- After the rendering process receives the document information , Start Parsing pages and loading sub resources , Finish rendering the page .
From input URL Show to page
1. User input
The key word entered in the address bar is Search content , still Requested URL.
- If it's search content , The address bar will use the browser's default search engine , To synthesize new search keywords URL;
- If it is judged that the input content is consistent with URL The rules , The address bar will add this paragraph to the agreement according to the rules , To synthesize into a complete URL.
2. URL Request process
Next, we enter the page resource request process . Browser process through Interprocess communication (IPC) hold URL Request sent to network process , Network process received URL After the request , Will initiate real URL Request flow .
Specific process : The network process looks for whether the resource is cached locally . If there are cache resources , Directly return resources to the browser process ; If the resource is not found in the cache , Then go directly to the network request process . The first step before this request is to DNS analysis , To get the server requesting the domain name IP Address . If the request agreement is HTTPS, Then we need to build TLS Connect .
utilize IP Address and server establishment TCP link . Browser side build request line 、 Request header 、 Domain name related Cookie Wait for data to be attached to Request header , Then send the request to the server .
Request received by server , Generating response data ( Include response lines 、 Response header and response body ), And send it to the network process . After the network process receives the response data , Start parsing the content of the response header .
(1) Redirect
If you find that the returned status code is 301 perhaps 302, It indicates that the server needs the browser to redirect to other URL. The network process will start from the response header Location Field to read the redirection address , Relaunch HTTP perhaps HTTPS request .

(2) Response data type processing
Content-Type: Tell the browser what type of response body data the server returns
If it's a download type , Then the request will be submitted to the browser's download manager , At the same time URL The navigation flow of the request ends .
If it is HTML, Continue the navigation process .
3. Prepare the rendering process
Chrome The default strategy of is that each label corresponds to a rendering process . But if you open a new page from one page , And the new page and the current page belong to the same site , Then the new page will reuse the rendering process of the parent page . The government calls this default strategy process-per-site-instance
4. Submit documents
“ file ” refer to URL Requested response body data .
“ Submit documents ” Is sent by the browser process , The rendering process received “ Submit documents ” After the news , Will establish data transfer with network process “ The Conduit ” .
After the document data transmission is completed , The rendering process will return “ Confirm the submission ” Message to browser process .
The browser process is receiving “ Confirm the submission ” After the news , Meeting Update browser interface status , Including security status 、 Address bar URL、 The historical state of advance and retreat , And update the Web page .
5. Rendering phase
Once the document is submitted , The rendering process starts page parsing and sub resource loading .
summary
- The server can control the behavior of the browser according to the response header , Such as jump 、 Network data type judgment .
- Chrome By default, each label corresponds to a rendering process , But if two pages belong to the same site , These two tags will use the same rendering process .
- The navigation process of the browser covers all the stages from the user initiating the request to submitting the document to the rendering process .
边栏推荐
- JS foundation -- hijacking of this keyword
- Wechat sports field reservation of the finished works of the applet graduation project (7) mid-term inspection report
- JS foundation -- task queue and event loop
- Decoding webp static pictures using libwebp
- JS written test question -- deep copy of object
- Classic network learning RESNET code implementation
- Inheritance (prototype)
- mysql_ Create temporary table
- mysql_ Master slave synchronization_ Show slave status details
- Can bus baud rate setting of stm32cubemx
猜你喜欢

PHP record

Pagoda workman WSS reverse proxy socket legal domain name applet chat remove port

Arduino IDE for raspberry PI Pico development firmware localization installation tutorial

Selenium framework operation steelth.min.js file hides browser fingerprint features

Resolved (the latest version of selenium reported an error) attributeerror: module 'selenium webdriver‘ has no attribute ‘PhantomJS‘

Preliminary foundation JVM

List title of force buckle summary

Conceptual distinction between Po, Bo, VO, dto and POJO

Strategy mode, just read one article

Error: tomee required to support ear/ejb deployment
随机推荐
Tensorflow's study notes (I)
# CF #808 Div.2(A - C)
Matlab for circular pit
Review all frames before sum of SSM frames
Wechat sports field reservation of the finished works of the applet graduation project (5) assignment
mysql_ Master slave synchronization_ Show slave status details
Decoding webp static pictures using libwebp
mysql_ Case insensitive
mysql_ Account authorization permission recycling, account locking and unlocking, account creation and deletion
mysql_ Record the executed SQL
[jailhouse article] certify the uncertified rewards assessment of virtualization for mixed criticality
TypeScript
Wechat sports field reservation of the finished works of the applet graduation project (7) mid-term inspection report
Domain driven model (DDD)
Riotboard development board series notes (VIII) -- building desktop system
SQL Server 2022 installation
Wechat sports field reservation of applet completion works applet graduation design (8) graduation design thesis template
Use reflection to convert RDD to dataframe
Resolve the error: org.apache.ibatis.binding.bindingexception
FLASH read / write problem of stm32cubemx