15 useful tips for using Chrome DevTools that you should know
- How to prevent RAM for Google Chrome with The Great Suspender
- Instructions for installing Google Chrome on Ubuntu operating system
- Reset Chrome browser to the default setting on Windows 10
Google Chrome is the most popular web browser commonly used by developers. With a 6-week release cycle and an extensive set of development features that make the browser a must-have tool. These include many outstanding support features such as direct editing of CSS (live-editing CSS), use of consoles and debugger. Today, TipsMake.com will introduce you 15 tips to use Chrome DevTools useful and effective to help improve the workflow better .
1. Quickly convert files
If you use Sublime Text, you're probably too familiar with the 'Go to anything' coating. The good news for you is that Chrome DevTools also has this feature. You just need to press Ctrl + P (or Cmd + P with Mac) to quickly search and open any file in your project.
2. Search in source code
What if you want to search in source code? To search for a specific string in all the files loaded on the page, press Ctrl + Shift + F (or Cmd + Opt + F). This search method also supports both on Regular expression.
3. Scroll to the command line
After opening a file in the Sources tab, DevTools allows you to easily move to any command line by pressing Ctrl + G (or Cmd + L) and typing the number of the line you want to go to.
Or alternatively, you can press Ctrl + O (Cmd + O) instead of searching for a file, then enter ':' the line number needed.
4. Select the elements in the console
DevTools console supports several functions and variables to quickly select DOM elements:
- $ () - short for document.querySelector () . Returns the first element that matches the CSS selector in parentheses (Example: If you type $ ('div'), the first element element of the page will be returned).
- $$ () - short for document.querySelectorAll () . Returns a sequence of elements that match the CSS selector in brackets.
- $ 0 - $ 4 - When typing $ 0 will display the latest DOM element selected in the element control panel. $ 1 - $ 4 will display the DOM element Monday through Thursday.
5. Use a variety of carets & selections
This is another similar Sublime Text feature. While editing files, you can set up various carets by holding down the Ctrl key (Cmd with Mac) and clicking anywhere you want. Therefore, allow you to write code at multiple lines at the same time.
6. Preserve Log
By checking the ☑Preserve Log option in the Console Tab, you can keep logs in DevTools Console instead of deleting them each time you load the page. This feature is quite handy when you want to check for bugs (bugs) that appear right before the page has loaded.
7. Pretty Print {}
Chrome's Developer Tools provides a built-in 'beauty' tool that helps you format shortened code snippets into easy-to-understand code. To do this, click the {} symbol in the lower left corner of the open file in the Sources tab.
8. Device mode
DevTools provides mobile-friendly programming pages. The video from Google below will introduce you to some key features of Device mode such as screen adjustment, touch touch simulation and malfunctioning network connection status.
9. Sensor simulator
Another interesting feature of Device Mode allows the choice of simulating sensor of mobile devices such as touch screen sensors or accelerometers (accelerometer). You can even simulate your geographical position. To do this, select the Emulation -> Sensors tab under the Elements tab.
10. Color Picker
When selecting the color in the Style editor, you can click on the color preview and the color picker will appear. While the color picker is running, if you drag the mouse over the page, your mouse pointer will become a magnifying glass to help select the correct color for each pixel.
11. Force element state
DevTools provides a feature that simulates CSS states like :hover
and :focus
on elements, making it easy to style these elements. It is available from the CSS editor.
12. Visualize the shadow DOM
Textboxes, buttons or input in addition to basic elements are often hidden. However, you can access Settings -> General and select Show user agent shadow DOM for them to display specifically. You can even create your own styles for these textboxes, buttons or input to easily customize them as you like.
13. Select the next occurrence
If you select any root word, then hold Ctrl + D (Cmd + D) while editing the files in the Sources Tab, then the next occurrence of the words (like the original word) remains. will be selected, helping you edit all at once.
14. Change the color format
Hold down the Shift key and click on the color display box to change the format between rgba, hsl and hexadecimal format tables.
15. Edit files locally thanks to Workspaces
Workspaces is a useful feature of Chrome DevTools, making this tool a real IDE (Integrated Development Environment). Workspaces connects files in the Resources tab with files in the local project, so you can edit and save directly without copying / pasting (copying / pasting) your changes into text editors (edit text editing) outside.
To configure Workspaces, go to the Sources tab and right-click anywhere on the left panel and select Add Folder To Worskpace (Add a folder to Workspace), or just drag and drop the entire project folder into Developer Tools (Developer tools). Now the sub folders and all the files of the selected folder are ready to edit regardless of which page you are on. You can even link files in your folder to page files for easier editing and storage.
Refer to some more articles:
- Instructions on how to export saved passwords on Chrome browser into 1 file
- 8 websites that help programmers practice coding skills
- 26 useful websites should track if you are a web developer
Having fun!
You should read it
- Tips to help use Chrome on Android effectively may not know you
- 11 tips for learning Python for 'newbie'
- Chrome users must know these tricks
- Top 20 free programming learning websites need to bookmark immediately!
- Set of multiple choice questions about programming with P12
- Beginners of computer programming need to focus on what?
- With these 5 tips will help you improve the logic programming ability
- Set of multiple-choice questions on award-winning programming P5
May be interested
- 3 ways to restore Chrome's browsing historysometimes, you want to review your browsing history activities to find some information or website but unfortunately deleted your entire browsing history.
- 10 useful tips for Google Chromegoogle chrome is currently a very popular browser in the world thanks to its smoothness. here are 10+ useful tips for chrome browsers.
- Instructions for using the right mouse on Google Chromewhen you right-click, you have access to a number of options that help your work more smoothly and make the most of chrome's benefits. here are a few tips for using the right mouse button on google's browser that you may not know
- Fix the 'Your connection is not private' error in Chrome browserbasically, the cause of the 'your connection is not private' error or the 'net :: err_cert_date_invalid' error on the chrome browser is due to an ssl error. ssl (secure sockets layer) is used by websites to store all the information you enter on a secure and private page. the cause of the ssl error may be because the site's certificate is not issued by a recognized third party, the connection between the browser and the website may not be safe, ....
- Top 10 best Google Chrome extensions to avoid distractions when workingthis is a collection of utilities to help you focus on your work and avoid distractions with external factors
- How to update Google Chrome to the latest versionupdating chrome to the latest version will help you get new patches from the publisher as well as experience its new utilities and features. how to know if the current version of chrome is the latest and how to update it?
- How to lock Google Chrome profile with a passwordchrome allows you to easily switch profiles during web browsing. suppose in case if you lend your computer to another user and you don't want them to access your chrome profile - containing bookmarks, browsing history and even a password, ... then you can lock the profile. my chrome with a google account password.
- Put Google as the homepage on Google Chromegoogle is now a popular search site worldwide. and you can set google as your homepage on google chrome to access it immediately when surfing the web.
- Better Download Manager in Chrome with Downloadrwhen you click on a file download link in google chrome, the download progress bar will be displayed just below the browser interface. it displays information about the download process including the remaining time, speed, .. and you can hide it manually. in general, this progress bar is quite cumbersome and overwhelms a bit of the display space of the browser.
- How to restore Google Chrome tab on your phonewhen you accidentally close the google chrome browser tabs on your phone, you can easily reopen them when searching for history pages of access pages right on your browser.