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.
  • 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