r/javascript • u/[deleted] • Jun 07 '16
Firefox adds new feature to help developers with JavaScript errors
https://i.imgur.com/EOztwbI.gif19
u/cmhdave73 Jun 07 '16
Very nice. It's a small simple change but extremely useful as the MDN docs are some of the best out there. Hopefully this will encourage someone to NOT use w3schools ;)
1
u/natecahill Jun 07 '16
I'll just leave this here: http://github.com/nathancahill/fuck-w3schools
7
u/BoltKey Jun 07 '16
I use Chrome's personal blocklist.
2
u/natecahill Jun 07 '16
TIL. Wonder if there's something similar for Firefox.
0
u/kickass_turing Jun 08 '16
Chrome's personal blocklist
Probably "Chrome's personal blocklist" but installed in Firefox since Firefox is reimplementing Chrome's extensions API :D
0
Jun 07 '16
[deleted]
-1
u/expert-at-nothing Jun 08 '16
w3schools deserves nothing, even if the compliment now is, "They aren't as bad as they were"
They still have incomplete, out-of-date documentation.
1
Jun 08 '16
It's good for quickly referencing syntax, better then MDN IMO. If you want real docs though MDN blows w3schools away.
1
u/expert-at-nothing Jun 08 '16
Except for when it's incomplete or out of date... which historically has been true more often than not.
Why waste time on a half-assed reference documentation??
1
Jun 08 '16
I don't go out of my way to search on w3schools but if I forget some syntax or something relatively simple and I google it, if a w3schools result comes up it's usually good enough. If I want actual docs though I obviously go to MDN
92
u/ThraShErDDoS Jun 07 '16
MDN docs are really good. I always click them in they appear in my search results for generic terms.
59
u/pygy_ @pygy Jun 07 '16
I almost always add "MDN" to the query when searching for Web stuff.
16
Jun 08 '16
I sometimes download the entire mdn site as an offline reference.
29
20
u/TheIncredibleWalrus Jun 08 '16
Allow me to introduce you to the wonder that is Dash:
2
u/FoxxMD Jun 08 '16
There's also Alfred which is a great spotlight replacement and also allows custom searches.
3
u/TheIncredibleWalrus Jun 08 '16
That's not the same, we're talking about having the docs downloaded and indexed offline.
Alfred supports Dash btw.
1
1
u/fuck_with_me Jun 10 '16
I downloaded it a while ago and got docs for a few things. Never really used it though, as straight up docs are often not as helpful as stackoverflow, because normally when I encounter a problem it's very specific.
1
u/FreekyMage Jun 08 '16
anyone know of something similar for windows?
10
u/SgtPooki Jun 08 '16
devdocs.io
5
u/FallenSatan Jun 08 '16
Highly recommend this. I have been using it for the last two month, pretty much covers everything. It even offers offline mode. And its opensource.
1
u/tehciolo Jun 08 '16
Have been using it for at least a year. I can't even remember how many times I've CTRL+T + devdocs'd the hell out of web stuff.
6
6
3
u/ihsw Jun 08 '16
You can add
site:developer.mozilla.orgto your search query to search the website directly.4
1
1
u/Graftak9000 Jun 08 '16
My text editor has documentation built in including MDN as a resource. Quite amazing.
1
8
13
8
u/elmigranto Jun 08 '16
try {
// your stuff …
}
catch (e) {
const qs = encodeURIComponent(`[javascript] ${e}`);
window.location = `https://stackoverflow.com/search?q=${qs}`;
}1
25
Jun 07 '16
That...almost makes me want to go back to FF.
18
u/novacrazy _.dominateWorld() Jun 07 '16
You could try the Firefox Developer Edition when working on sites.
7
6
u/mwcz Jun 08 '16
They've done an amazing job of catching up to Chrome over the past several years.
1
2
u/kickass_turing Jun 08 '16
DevEdition is way too stable for me.
I use Firefox Nightly and it is FAST :D
7
10
Jun 07 '16
You know, nothing is stopping you from using multiple browsers. And since web developers should test their sites in multiple browsers it would stand to reason that you will need to use Firefox anyway.
12
Jun 07 '16
Of course I use multiple browsers. But I develop with Chrome. Developing with multiple browsers is like using multiple text editors/IDEs. The advantage gained by having access to different features is overshadowed by the overhead of keeping multiple sets of shortcuts and workflows in your head.
2
u/kickass_turing Jun 08 '16
I feel Chrome has fewer shortcuts for it's dev tools than Firefox.
1
u/THIS_BOT Jun 08 '16
I prefer Firefox's dev tools because it's far easier to customize and replay the customized requests through firefox. They just need to get to using Servo because the biggest thing holding back FF in my opinion is the rendering performance.
4
2
5
u/tswaters Jun 08 '16
I hope they add one for the mutating the prototype warning I see all the time...
2
u/aksmcifuenidn Jun 08 '16
That's likely from an es5 or es6 shim. Not really a problem that it's slowing down JavaScript if it makes your site more compatible across browsers.
2
u/tswaters Jun 08 '16
Depends on the site I'd say.... also the purpose of the feature and the like.
I'm of the opinion that oldIE can die in a fire so would be less pleased to see a
Array.prototypeaddition for something likeforEachwhich is supported pretty much everywhere.That said, it might get people actually read the help link and if they learn that change the prototypes once assigning them is bad, well maybe the web becomes a better place.
But then again, I wager the majority come from es5->6 where babel mutates the prototype when using
classandextendssuch is life.
4
u/brunusvinicius Jun 08 '16
This remembers me Angular 1 erros. We got a link to the documentation.
3
Jun 08 '16
documentation
We got a link to a page showing you the same error again with helpful info that did simply not help in 99% of the cases.
2
2
1
1
u/serial_crusher Jun 08 '16
I've been a Firebug user since before Firefox built their own developer tools. Have they matured enough that I should make the switch?
(I do more development in Chrome these days either way though...)
1
1
1
u/lalwanivikas Jun 08 '16
Is it possible to make this for Chrome as well?
(Google obviously can, but can we as outside devs can also do it?)
1
u/KyleRochi Jun 08 '16
Probably, google has a great extension development api for chrome
1
u/yooossshhii Jun 08 '16
I browsed through their extension APIs and doesn't look like there's anyway to intercept or react to an error event. I'd love to be proved wrong though.
1
u/KyleRochi Jun 09 '16 edited Jun 09 '16
Hmm, looks like you're right :(. I've only ever developed what feels like "front-end" plugins using their JavaScript API. This feels like it may be something a little closer to the source code :/ I'm not sure they even have an API for the underlying code. I will look into it if I find some time because I would love to write some more chrome plugins :P
Edit: Maybe using events to listen for JavaScript errors. Granted I haven't really read the whole page but that seems like the only thing on there that would be remotely capable of this functionality.
1
Jun 08 '16
If only the debugger wasn't the slowest application in the world, I'd be more inclined to use it for development.
3
u/kickass_turing Jun 08 '16
Firebug is slow, not Firefox dev tools. Uninstall Firegbug if you are using it and try out DevEdition it's quite fast!
6
u/mwcz Jun 08 '16
So true. Firebug set the standard but it's completely outdated and slow now. Both FF and Chrome have excellent dev tools natively these days.
1
u/kickass_turing Jun 08 '16
Firebug 3.0 is working on a new async e10s api but I don't know when it will be ready
1
Jun 08 '16
I've been using vanilla Firefox Developer edition for several months and I'm afraid I have to report it is still slow as molasses. I'm working on a fairly sizeable SPA, and its Javascript tools just chug.
-3
-2
u/TimmyLA Jun 08 '16
How would this different from what we already have on chrome ?
5
u/vinnl Jun 08 '16
It links to pages on MDN giving more information on specific errors you're running into.
24
u/[deleted] Jun 07 '16
Full article: https://hacks.mozilla.org/2016/06/helping-web-developers-with-javascript-errors/