Înapoi la articole →

Cel mai recent articol

Ultima verificare

Urmăritori 0 urmăritori
Articole: 184
  1. Sometimes pausing execution when a line of JavaScript is executed is too much, sometimes you only want to know that the line was executed at all, not pause there.

  2. Some users make use of assistive technology, like screen readers (e.g.

  3. The various resources loaded by your site aren't always guaranteed to reach your users when they visit your site.

  4. When creating or modifying a design prototype for the web, you may want to quickly edit content in the browser without having to find the relevant code.

  5. Have you ever wanted to know what caused a specific DOM node or element to be created in the page?

  6. While you may develop your website on a fast network connection at home or at work, your users may not be able to use it with an equally fast connection.

  7. Firefox features a position editor that lets you move elements in the page by drag and drop.

  8. You can easily copy an element's XPath expression from DevTools.

  9. Convert font property units

    Font CSS properties such as font-size, line-height or letter-spacing can be expressed in multiple different length units (like many other CSS properties).

  10. If you want to learn more about what other tools exist in a browser, or what features a given tool provides, you can find reference documentation from all the major browsers here: Firefox Developer Tools Edge Developer Tools Chrome Developer Tools Safari…

  11. If you need to move nodes or elements around in the DOM tree, to re-order things in the page, you can do it by drag and dropping nodes around in the Elements (or Inspector) panel.

  12. Sample colors from the page

    Being able to sample colors from the page is super useful.

  13. This is not really a tip, but rather an interesting thing to be aware of when debugging JavaScript.

  14. Users who do not or can't use a mouse or trackpad can use the tab key to navigate through focusable elements on the page.

  15. With HTML, you can add alternative text to images using the alt attribute.

  16. The console.log output can be styled in DevTools using CSS. console.log('%c Hello World', 'color: orange; font-size: 2em;');

  17. Simple, yet powerful, * { outline: 1px solid red; } is a useful debugging trick that helps understanding the page structure, finding overflow bugs or understand why elements are being pushed away for no apparent reason.

  18. By default, the messages displayed in the console get removed as soon as you refresh the page (or navigate to a new page).

  19. $ and $$ are 2 functions you can use in the console to find elements in the page.

  20. Edit CSS angles

    In CSS, several different properties use angle unit values, such as the rotate() function of a transform or the linear-gradient orientation of a background-image, and more.

  21. People who visit your web pages may have different types of color vision deficiencies that, if you incorrectly use colors for meaning, may affect their experience.

  22. The console panel supports a very handy copy() function that stringifies and copies anything you pass to it as an argument, so you can then paste it somewhere else.

  23. The clip-path property is a great way to change the final shape of an element and give it the shape that you want.

  24. In Firefox, when inspecting elements (in the Inspector panel), you can click on the custom badge to go straight to the custom element's JavaScript source code.

  25. If you selected an element in the Elements panel (in Chrome, Safari, Polypane or Edge) or the Inspector panel (in Firefox), you can refer to it in the console using $0.

  26. In Edge, Polypane and Chrome, whenever you use the element selector and hover over elements in the page, a tooltip appears with, among other things, some accessibility information about the hovered element.

  27. Chrome and Edge both have a visual editor useful for tweaking flexbox and grid alignment properties.

  28. The Network panel lets you filter requests by status code, or mime type, and more.

  29. When logging performance.timing events to the console, they appear in alphabetical order since they are properties of the PerformanceTiming object.

  30. If you prefer to use console.log() statements rather than the JavaScript debugger because you find it difficult to set breakpoints in DevTools (or you can't), then you can use the debugger statement in JavaScript.

  31. Edit CSS filters

    The filter property in CSS lets you change the way a particular element gets rendered.

  32. You can expand all descendants under a given DOM node in one go, to avoid having to expand each node one by one, which may take a while.

  33. When you want to know which elements a given CSS rule will apply to, in addition to the currently selected element, you can: In Firefox: In the Style Editor panel: hover over any rule selector for some time.

  34. Sometimes, the JavaScript code that runs on a website is minified and really hard to read.