Discussion
Loading...

#Tag

Log in
  • Sign up
  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Lord Caramac the Clueless, KSC and 2 others boosted
blinry
blinry
@blinry@chaos.social  ·  activity timestamp last week

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

First, a really convenient thing: You can "pop out" the Toolbox into a separate window!

To do this, open the Toolbox (using F12), click on the ellipsis menu on the right, and select "Separate Window".

I like this much better than the default "docked" modes, especially when using a scrolling window manager like #niri!

#webdev #devtools

Screenshot of Firefox' DevTools toolbox. I show the described menu.
Screenshot of Firefox' DevTools toolbox. I show the described menu.
Screenshot of Firefox' DevTools toolbox. I show the described menu.
  • Copy link
  • Flag this post
  • Block
Lord Caramac the Clueless, KSC and 1 other boosted
blinry
blinry
@blinry@chaos.social  ·  activity timestamp last week

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.

I first get all <p> elements, then append exclamation marks to all of them using $_. Then, I add question marks to one specific <p> element using $0.
I first get all <p> elements, then append exclamation marks to all of them using $_. Then, I add question marks to one specific <p> element using $0.
I first get all <p> elements, then append exclamation marks to all of them using $_. Then, I add question marks to one specific <p> element using $0.
  • Copy link
  • Flag this post
  • Block
blinry
blinry
@blinry@chaos.social  ·  activity timestamp last week

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*!

I run $$("p") to output all <p> elements on the page.
I run $$("p") to output all <p> elements on the page.
I run $$("p") to output all <p> elements on the page.
blinry
blinry
@blinry@chaos.social replied  ·  activity timestamp last week

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.

I first get all <p> elements, then append exclamation marks to all of them using $_. Then, I add question marks to one specific <p> element using $0.
I first get all <p> elements, then append exclamation marks to all of them using $_. Then, I add question marks to one specific <p> element using $0.
I first get all <p> elements, then append exclamation marks to all of them using $_. Then, I add question marks to one specific <p> element using $0.
  • Copy link
  • Flag this comment
  • Block
blinry
blinry
@blinry@chaos.social  ·  activity timestamp last week

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

First, a really convenient thing: You can "pop out" the Toolbox into a separate window!

To do this, open the Toolbox (using F12), click on the ellipsis menu on the right, and select "Separate Window".

I like this much better than the default "docked" modes, especially when using a scrolling window manager like #niri!

#webdev #devtools

Screenshot of Firefox' DevTools toolbox. I show the described menu.
Screenshot of Firefox' DevTools toolbox. I show the described menu.
Screenshot of Firefox' DevTools toolbox. I show the described menu.
  • Copy link
  • Flag this post
  • Block

Bonfire social

This is a bonfire demo instance for testing purposes

Bonfire social: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.1 no JS en
Automatic federation enabled
Log in Create account
  • Explore
  • About
  • Members
  • Code of Conduct