How a Browser Works Flashcards

1
Q

What are browsers based on?

A

Threads AKA a queue that processes tasks sequentially

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Previous browsers were single thread. What does that mean?

A

Older browsers like IE6

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are some of the problems with single-thread browsers?

A

Instability, low performance, insecurity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

With regard to instability, what exactly is the issue with single-thread browsers?

A

You can get a thread crash which leads to a stop in the process and causes the browser to freeze

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

With regard to low performance, what exactly is the issue with single-thread browsers?

A

There are two things that we can potentially attribute to low performance:
1. Javascript takes time, and while it was executing the script, the page render thread waws being blocked.
2. Memory leakage - browser kernel complex. Garbage collection didn’t always work. The longer you used the browser, the more memory was taken from the system.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

insecurity

With regard to insecurity, what exactly is the issue with single-thread browsers?

A

Plugins could gain access to the OS with admin permissions via the single thread. Javascript can read sensitive information when you interact with the browser like password input.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What’s the primary advantage that a multi-threaded browser has over a single-threaded browser?

A

It can process faster because multiple threads can operate simultaneously. Threads share the date in memory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the first step in loading a web page, and what are the two primary foes?

A

Navigation is the first step and it occurs whenever a user requests a page by entering a URL into the address bar, clicking a link, submitting a form, etc.

Latency and bandwidth are the two main enemies.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Give me a summary of what’s happening when a page gets displayed.

A
  1. The browser process handles user input and composes a URL request.
  2. Network process sends URL request initiating the Navigation phase.
  3. The browser process creates a renderer process after receiving the server response. The renderer process would be on standby at this point while the network process receives the document.
  4. The browser commits the navigation. Network process starts sending document data to the renderer process ending the navigation phase.
  5. The renderer process renders the document.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How many steps and how many processes in the broswer are around during the navigation phase?

A

5 steps:
1. Handling user input (BROWSER PROCESS)
2. Sending URL request (NETWORK PROCESS)
3. Prepare the render process (BROWSER PROCESS)
4. Committing navigation (RENDER PROCESS)
5. Rendering page (RENDER PROCESS)

Steps 2-4 are involved in the navigation process.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does it mean to handle user input?

A

It all begins with a request for a web page - an HTML request. BEFORE the navigation process begins, the UI (user interface) thread in the browser process will parse the user input. There’s two distinct possibilities when there’s user input:
1. Search query
2. A URL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What’s happening when the user input is a search query?

A

During a search query, the keywords get parsed, a URL with the search query gets composed, and then a URL request is initiated.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What’s happening when the user input is a URL?

A

The address bar will attach protocol (usu. HTTP or HTTPS). For example, medium.com becomes https://medium.com. When the user hits return, the browser reads the URL from the address bar and sends the URL request to a network process via inter-process communication.

Now, a “beforeunload” event is fired, the tab icon changes to a loading spinning while the web page doesn’t change.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly