Înapoi la articole →

Cel mai recent articol

Ultima verificare

Urmăritori 0 urmăritori
Articole: 184
  1. By default, the Network tool displays the name of each requested resource.

  2. To make sure your webpage loads and appears fast for your users, load only the CSS and JS code that your page requires to appear correctly.

  3. For a super smooth user experience on your website or app, it's better if the browser manages to render your page at a high framerate.

  4. Throttle your CPU

    Your development machine is very likely much more powerful than the devices your users have (which are probably low-end mobile devices).

  5. To know how much data your website transfers between the server and the client to display images, or scripts, or anything else: Open the Network tool.

  6. Using the about:inspect special page you can see your website's logs in Chrome or Edge running on iPhone!

  7. Some websites make it impossible to use DevTools by adding debugger statements in their code.

  8. Emulate color schemes

    In CSS, you can use the prefers-color-scheme media feature (docs) to detect if the user prefers using a light or a dark theme in their operating system.

  9. Autofill forms for testing

    In Polypane you can right-click any form on the page and select Autofill form to add dummy values to all input elements.

  10. When a page loads, and all of its global objects are ready, but before the JavaScript code of the page actually kicks-in, is a great time to inject debugging code.

  11. Show web vitals

    Web vitals are a set of metrics that help you determine how well-built your page is.

  12. Instead of simulating devices one by one and switching between them, Polypane supports testing on multiple simulated devices and viewports at the same time.

  13. While working on a page locally and you're not using a hot reloading dev server, you need to reload the browser yourself to see the change.

  14. Debug unwanted scrollbars

    Scrollbars can sometimes appear on a webpage unexpectedly.

  15. The Idle Detection API is useful for web developers to detect when the user isn't interacting with their device.

  16. Edge (starting with 110), Firefox and Polypane all have a very nice JSON viewer tool that makes it easy to view JSON responses from your server directly in the browser window.

  17. Progressive Web Apps (PWA) can register themselves to handle URIs with pre-defined or custom protocols (such as mailto, geo, or web+foo).

  18. When it comes to improving web rendering performance, we often spend time working on JavaScript code.

  19. You've probably already used console.log() in your code to print debugging values to the Console tool in DevTools.

  20. When selecting elements from the page using the inspect tool, the hovered elements get highlighted, and an information tooltip follows your mouse around and gives you information about the hovered element.

  21. DevTools comes with tons of keyboard shortcuts.

  22. Flexbox is a great way to easily distribute elements and empty space in a row or a column, and create interesting layouts.

  23. Re-use scripts as snippets

    The Console is great to write short JavaScript expressions that read from the document or manipulate it.

  24. All browser DevTools have a built-in mode that you can use to test a webpage under different screen sizes and device capabilities.

  25. Sometimes, when debugging JavaScript code in DevTools, you may want to test a quick change and see whether that fixes the bug.

  26. Debugging JavaScript can quickly get out of hand when you have a lot of code and many functions that call each other.

  27. There's a lot of tools in DevTools already, probably more than you use.

  28. If you want to use DevTools in another language than English, you can do it across all major browsers.

  29. Imagine you evaluate a long expression like $$('*').map(el => Object.values(el.attributes).map(attr => {return {name: attr.name, value: attr.value}})) which extracts the attributes from all of the DOM elements on the page.

  30. If your website has features that depend on the geographic location of your users, you can test these features by simulating different geolocations right from DevTools!

  31. Find inactive CSS styles

    Sometimes we write CSS code that's entirely valid but has absolutely no effect at all, and this can be frustrating.

  32. If you type $0 in the Console tool, in any browser, the currently selected DOM node is returned.

  33. Inspect CSS animations

    Modern browser DevTools provide a handy tool to inspect and modify CSS animations, CSS transitions, and Web animations.

  34. A lot of websites these days get covered with overlays and crammed with lots of ads and other things that make it hard to just read the content of the page.

  35. To uniquely identify an element that lacks an identifier, so that you can reference the element in JavaScript and other places, use DevTools' ability to copy unique CSS selectors.

  36. JavaScript often needs references to DOM nodes on the page.

  37. In HTML, it's possible for certain attributes to reference other elements by their IDs.

  38. There are multiple ways to detect and fix color contrast issues with DevTools, but here is a nice one to keep in mind.

  39. Here is a nice tip to quickly empty your cache and refresh the page, in order to test new code changes: In Chrome, or Edge, open DevTools (F12).

  40. Sometimes, either by accident or on purpose, HTML elements end up outside of the visible browser viewport.

  41. Using the keyboard can be faster than using a mouse in certain cases (and for some people).

  42. You can simulate various different devices from DevTools, to get an idea of how your webpage might render on those devices (note that this is only a simulation, the tool only changes the screen dimensions, touch event handling, and user agent string, but…

  43. Discover all the tools

    DevTools is confusing!

  44. Copy an elements styles

    You can extract all the styles of an element in one go by using the Copy styles feature.

  45. Amelia Bellamy-Royds shared a really cool tip to spell-check a webpage's content from DevTools: Open DevTools, and go to the Console tool.

  46. Cascade layers is a CSS feature that allows web developers to define their CSS styles in multiple layers and control the order in which these layers apply.

  47. Edge has a very useful Issues panel that can automatically list a lot of different issues with your site.

  48. You probably know about console.log() already, it's a great way to print variables and objects to the console while the code is running, to debug it.

  49. In Debug popups that appear on hover using JS we described how to pause the debugger to inspect popups that appear on hover and disappear as soon as the cursor moves away.

  50. With DevTools you can detect low color contrast issues which is great.