Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Darkly)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Uncategorized
  3. Here's a thread of cool things I found exploring the #Firefox Developer Tools!

Here's a thread of cool things I found exploring the #Firefox Developer Tools!

Scheduled Pinned Locked Moved Uncategorized
firefoxniriwebdevdevtools
25 Posts 7 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • blinryB blinry

    There's a couple more, like copy(), which copies its argument to your clipboard, or keys(), an abbreviation for Object.keys().

    If you ever forget these console helpers, you can run :help to open the page of the documentation that explains them!

    https://firefox-source-docs.mozilla.org/devtools-user/web_console/helpers/

    blinryB This user is from outside of this forum
    blinryB This user is from outside of this forum
    blinry
    wrote last edited by
    #16

    There's a built-in multi-line editing mode! Press Ctrl+B to turn it on. Seems useful to write longer expressions.

    This mode shares its history with the regular one-line mode.

    blinryB 1 Reply Last reply
    0
    • blinryB blinry

      There's a built-in multi-line editing mode! Press Ctrl+B to turn it on. Seems useful to write longer expressions.

      This mode shares its history with the regular one-line mode.

      blinryB This user is from outside of this forum
      blinryB This user is from outside of this forum
      blinry
      wrote last edited by
      #17

      But also, I learned that the one-line mode tries to guess whether your command is incomplete when you press Enter, and then allows you to type a second line.

      You can force a new line using Shift+Enter.

      blinryB 1 Reply Last reply
      0
      • blinryB blinry

        But also, I learned that the one-line mode tries to guess whether your command is incomplete when you press Enter, and then allows you to type a second line.

        You can force a new line using Shift+Enter.

        blinryB This user is from outside of this forum
        blinryB This user is from outside of this forum
        blinry
        wrote last edited by
        #18

        That's all cool things I found in the Firefox DevTools today! Looking forward to check out the other tabs some other time.

        It's kind of eye-opening for me how many convenient things a tool like that has. So far, when I opened the Toolbox, I usually quickly wanted to get something specific done, and didn't take the time to wander & explore…

        What are your favorite built-in dev tools in Firefox? What did I miss in "Inspector" and "Console" today?

        blinryB 1 Reply Last reply
        0
        • blinryB blinry

          Next, I looked at the Console.

          I learned that it has some predefined helper functions! You can use `$(selector)` as an abbreviation for `document.querySelector(selector)`.

          Similarly, `$$(selector)` is short for `document.querySelectorAll(selector)`!

          Even though this reeks of jQuery, I think these are fantastic in this context and I might use them *a lot*!

          Adam KatzA This user is from outside of this forum
          Adam KatzA This user is from outside of this forum
          Adam Katz
          wrote last edited by
          #19

          @blinry what is the difference between $$(…) and $$$(…)? I didn't know about $$(…)

          Nicolas ChevobbeN 1 Reply Last reply
          0
          • blinryB blinry

            That's all cool things I found in the Firefox DevTools today! Looking forward to check out the other tabs some other time.

            It's kind of eye-opening for me how many convenient things a tool like that has. So far, when I opened the Toolbox, I usually quickly wanted to get something specific done, and didn't take the time to wander & explore…

            What are your favorite built-in dev tools in Firefox? What did I miss in "Inspector" and "Console" today?

            blinryB This user is from outside of this forum
            blinryB This user is from outside of this forum
            blinry
            wrote last edited by
            #20

            Ohh, the CSS pane helps you debug values of the "transform" property by showing you the box before and after the transformation!

            1 Reply Last reply
            0
            • Adam KatzA Adam Katz

              @blinry what is the difference between $$(…) and $$$(…)? I didn't know about $$(…)

              Nicolas ChevobbeN This user is from outside of this forum
              Nicolas ChevobbeN This user is from outside of this forum
              Nicolas Chevobbe
              wrote last edited by
              #21

              @adamhotep @blinry $$$ will retrieve éléments in the shadow dom, which is not the case for $$ (see https://firefox-source-docs.mozilla.org/devtools-user/web_console/helpers/ for the full doc)

              blinryB 1 Reply Last reply
              0
              • Nicolas ChevobbeN Nicolas Chevobbe

                @adamhotep @blinry $$$ will retrieve éléments in the shadow dom, which is not the case for $$ (see https://firefox-source-docs.mozilla.org/devtools-user/web_console/helpers/ for the full doc)

                blinryB This user is from outside of this forum
                blinryB This user is from outside of this forum
                blinry
                wrote last edited by
                #22

                @nicolaschevobbe @adamhotep I also had to look that up, but here's an example where a shadow DOM is used: In MDN's web dev playground, they want to isolate the CSS you write to only act on "your" HTML, not on the entire site. So they put it in a shadow root.

                So $$ doesn't access the <h1> here, but $$$ does!

                Adam KatzA 1 Reply Last reply
                0
                • blinryB blinry

                  @nicolaschevobbe @adamhotep I also had to look that up, but here's an example where a shadow DOM is used: In MDN's web dev playground, they want to isolate the CSS you write to only act on "your" HTML, not on the entire site. So they put it in a shadow root.

                  So $$ doesn't access the <h1> here, but $$$ does!

                  Adam KatzA This user is from outside of this forum
                  Adam KatzA This user is from outside of this forum
                  Adam Katz
                  wrote last edited by
                  #23

                  @blinry @nicolaschevobbe while I've got your attention, do you know how to inject helper JS code (just some functions) into a document for the Console? I only know how to do it in a UserScript, which means it's not available from the Console.

                  1 Reply Last reply
                  0
                  • blinryB blinry

                    There are more "Console Helpers" in #firefox:

                    $_ is a shortcut to the result of the last expression you executed, allowing you to do some neat step-by-step exploration.

                    And $0 refers to the currently-inspected element on the page.

                    ? Offline
                    ? Offline
                    Guest
                    wrote last edited by
                    #24

                    @blinry That's very Perl-like!

                    1 Reply Last reply
                    0
                    • blinryB blinry

                      There are more "Console Helpers" in #firefox:

                      $_ is a shortcut to the result of the last expression you executed, allowing you to do some neat step-by-step exploration.

                      And $0 refers to the currently-inspected element on the page.

                      jetcoolJ This user is from outside of this forum
                      jetcoolJ This user is from outside of this forum
                      jetcool
                      wrote last edited by
                      #25

                      @blinry you can right-click an element and "Use in Console" will create a temporary variable with that element

                      1 Reply Last reply
                      0
                      • R ActivityRelay shared this topic
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      Powered by NodeBB Contributors
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups