How to use developer tools on chrome


















Improve this question. Add a comment. Active Oldest Votes. Search for http headers for more information on which are teh standard headers. Improve this answer. Juan Juan 5, 2 2 gold badges 13 13 silver badges 25 25 bronze badges. Yes, these are the HTTP headers that were sent with the response to your request. Kayce Basques Kayce Basques Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name.

Email Required, but never shown. The Overflow Blog. Podcast Making Agile work for data science. Stack Gives Back DevTools shows a screenshot of the page at that point in time. Move your mouse left and right to replay the recording.

This is called scrubbing, and it's useful for manually analyzing the progression of animations. Figure 7 : Viewing a screenshot of the page around the ms mark of the recording. In the Frames section, hover your mouse over one of the green squares. DevTools shows you the FPS for that particular frame. Each frame is probably well below the target of 60 FPS.

Of course, with this demo, it's pretty obvious that the page is not performing well. But in real scenarios, it may not be so clear, so having all of these tools to make measurements comes in handy. A new overlay appears in the top-right of your viewport.

You won't be using it in this tutorial. Now that you've measured and verified that the animation is not performing well, the next question to answer is: why? Note the summary tab.

When no events are selected, this tab shows you a breakdown of activity. The page spent most of its time rendering. Since performance is the art of doing less work, your goal is to reduce the amount of time spent doing rendering work. Expand the Main section. DevTools shows you a flame chart of activity on the main thread, over time. The x-axis represents the recording, over time.

Each bar represents an event. A wider bar means that event took longer. The y-axis represents the call stack.

When you see events stacked on top of each other, it means the upper events caused the lower events. There's a lot of data in the recording. The Main section and Summary tab only display information for the selected portion of the recording. Note : Another way to zoom is to focus the Main section by clicking its background or selecting an event, and then press the W, A, S, and D keys. Note the red triangle in the top-right of the Animation Frame Fired event. Whenever you see a red triangle, it's a warning that there may be an issue related to this event.

Click the Animation Frame Fired event. The Summary tab now shows you information about that event. Note the reveal link. Also note the app. Clicking that jumps you to the relevant line in the source code. Note : After selecting an event, use the arrow keys to select the events next to it.

Under the app. If they were wider, it looks as though each one might have a red triangle on it. Click one of the purple Layout events now. DevTools provides more information about the event in the Summary tab. Indeed, there's a warning about forced reflows another word for layout. The next approach to inspecting the element is using the DOM panel.

In the above picture, pointer 1 shows the " select an element " button. When we click this button and then select any element we want to inspect, that element gets highlighted on the webpage.

For example, in the above image, we have selected the menu class, and that element gets highlighted BLOGS in the navigation bar. The DOM panel of Chrome DevTools provides a special tool called " find " to locate the web elements depending on specified criteria. The find tool indicates the red square in the above image.

We can see that the criteria that we can specify in the find tool are string , CSS selector , or XPath. Hence we can search for elements or nodes in the find tool:. In the above image, we have specified " selenium " as a string.

It highlights all the entries with the value " selenium ". We can see at the right of the find tool that gives us the total number of entries and which entry number is currently highlighted in the above image, the total findings being It also gives us a button for scrolling the entries.

We can also specify the CSS selector in the find tool, and it will give us all the entries associated with the specified selector. So how do we find a CSS selector for a particular tag?

In the elements panel, we can right-click on any tag for which we want the CSS selector and select the Copy option. Then we can copy the tag as a CSS selector. It is as seen in the below screenshot.

The selector is. Note that nth-child 2 implies the exact tag which we had selected. The image below shows an example of providing a CSS selector in the find box. We can also specify XPath as a search string to the " find " tool. When we give a valid XPath , the find tool searches the appropriate node for us. Note that we can also retrieve XPath for a particular element using the Copy option, as shown above. Consequently, consider the following image.

The above expression indicates we are looking for a node ' script ' with the given id attribute value. As shown in the image, the find tool highlights the result obtained pointed by the red-colored arrow.



0コメント

  • 1000 / 1000