I’ll be honest, I mostly use Chrome for web development. This is partially because my current job calls for developing things that only use webkit and Chrome (I know this sounds odd…it is pretty unusual), but, regardless, Firefox is also a fine browser, if not the current golden child. Maybe this is old news for people who develop with Firefox, but the Scratchpad on Firefox is, in my opinion, noteworthy enough to warrant its own post.
Firefox’s Scratchpad is basically a small text editor linked closely with the Firefox console. That doesn’t sound very cool at face value, but, consider:
<script> tags inline). I could perhaps use a REPL from inside a Sublime Text package or perhaps one within Node…but, the point is, all of these solutions have some tedious or inefficient work involved.
How about this:
- Open Firefox.
- Click on Tools > Web Developer > Scratchpad
- Select with your cursor only what you want the browser to evaluate.
- Hit command-R to run the function in the browser, or hit command-L to display the function’s output (so, not side effects of the function).
It’s also truly a scratchpad: you can selectively run what you write using simple text selection, meaning you can easily iterate over a given idea or function without having to continually comment out your code. If you hit Command-L to display your results in the Scratchpad itself, you can easily see errors displayed and work through them there.