views:

1262

answers:

8

I like to keep javascript debugging enabled in my browser so when I'm developing my own code I can instantly see when I've made an error.

Of course this means I see errors on apple.com, microsoft.com, stackoverflow.com, cnn.com, facebook.com. Its quite fun sometimes to see just how much awful code there is out there being run by major sites but sometimes it gets really annoyed.

I've wondered for YEARS how to change this but never really got around to it. Its particularly annoying today and I'd really like to know of any solutions.

The only solution I have is : use a different browser for everyday browsing.

I'm hopin theres some quick and easy plugin someone can direct me to where I can toggle it on and off based upon the domain i'm on.

Edit: I generally use IE7 for everyday browsing

+6  A: 

Firebug lets you enable/disable debugging for different domains.

Breton
+2  A: 

Firefox lets you use different profiles. Each profile can have separate preferences, themes and plugins. Start firefox on Windows this way: firefox.exe -ProfileManager to create or manage profiles.

I use Firefox and Webkit for web debugging and Safari for regular web browsing, however. Firefox is just better for web development, and I prefer Safari overall.

apphacker
+1  A: 

I keep those annoying popups on for Internet Explorer, and you're right. It's amazing how few developers ever bother testing their code in IE. As a web developer, it's sorta your duty, right? Seeing as how it still accounts for like 60% of traffic to most sites.

Anyway, in answer to your question, I simply switched to Chrome for everyday browsing, and only use IE for testing and developing.

Jason Kester
+1  A: 
voyager
+6  A: 

Script Debugging in IE7 is controlled by a registry key. (An addon could probably toggle it. I just don't know of any.)

So, how I handle this is to write a registry script to turn it on or off. Then, I put a link to those scripts on my windows quick-launch bar and change their icons to be more appropriate. Then, I can just click one of the links to turn on or off IE script debugging.

Turn Off:

REGEDIT4

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main]
"Disable Script Debugger"="yes"
"DisableScriptDebuggerIE"="yes"

Turn ON:

REGEDIT4

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main]
"Disable Script Debugger"="no"
"DisableScriptDebuggerIE"="no"
EndangeredMassa
you need to restart IE right for each instance.maybe add 'iexplore.exe' to the end of the script and then create two shortcuts in your quicklaunch bar to run a 'debug' or 'normal' version of IE.
Simon_Weaver
Yes, this requires an IE restart. I use this method even though I use Chrome for normal browsing. Your idea sounds better if you stick with IE as a primary.
EndangeredMassa
Since these registry keys are user-bound, would running a browser instance as another user ("run as...") for whom debugging is enabled work?
Ates Goral
A: 

CompanionJS doesn't let you toggle debugging on a domain basis, but makes the error messages less obtrusive for casual surfing, and makes script debugging in general more user friendly.

Kristian J.
A: 

Chrome doesnt bug you unless you first open the javascript debugger window

Simon_Weaver
Anyone know of a way to tell Chrome to open the debugger window upon F12? Firebug trained me to do that, I can't seem to break the habit. It's lame to have to go to the menu for that.
Nosredna
A: 

If you want to test and debug JavaScript, Firefox and Firebug are unrivalled in terms of features and ease of use. Chrome is not as powerful as Firebug, no matter what anyone else tells you.

Dwayne