Secret to Debugging JavaScript in Safari

// February 2nd, 2006 // Technology Bits

The only major problem I’ve had with Apple’s Safari web browser has been its annoying lack of ability in debugging javascript. However, I was wrong to complain about that. Safari has a very good, detailed “Debug” menu which is far superior to any of the default debug abilities in any of the other major browsers. (This is of course without any plug-ins such as the Web Developer or Firebug in Firefox)

The problem really is that the “Debug” menu is disabled by default for everyone.

Safari Enhancer solves that problem. Install this simple program and with a single checkbox you can show all the nice goodies Apple has been hiding from us.

apple,mac,safari,plug-in,add-on,plugin,addon,javascript,firefox,web development,development,firebug,web developer,enhancer,DOM,debug,web

11 Responses to “Secret to Debugging JavaScript in Safari”

  1. From the Safari Developer FAQ:

    To display the debug menu, open a Terminal window and type:

    defaults write com.apple.Safari IncludeDebugMenu 1

    Unfortunately, the JavaScript debugger in Safari is as bad as the default error messages in Internet Explorer. But, being able to output to the console really makes up for it (almost). You can just do:

    window.console.log("hello world");

  2. zbtirrell says:

    ooh, that’s even cleaner than the application I got, I’ll definitely use that method at home!

  3. jlu says:

    I use javascript debugger everyday.
    The best javascript debugger I saw so far is Microsoft’s Script Editor. If you have MS Office, it’s likely you already have it.
    Firefox Venkman is ok, although not as user friendly.
    Most of Safari debugging “tools” are useless. Most of the time I have to use javascript alerts to debug on Safari.

  4. Pooja says:

    In Safari, If i need to get the value as
    document.list_form.guarantorPersValuesSpain.value =2;
    alert(”testing result 1=”+ test );
    test += 2;
    alert(”testing result 2=”+ test );

    It results
    ————
    testing result 1=

    testing result 2= 2

    why the first alert value is blank and second alert has not resulted as “22″.
    Can anyone resolve it??

    Thanks & regards,
    Pooja

  5. devel says:

    Safari debug is shitty and useless

  6. developer99 says:

    Safari for developers is crap. Drosera freezes regularly and the debugging tools have got to be the crappiest ive seen yet. No comparison to firebug… frustrating to say the least. Stop trying to reinvent the wheel, and take some notes on what works.

  7. Rob says:

    Thanks for the article… it helped me find something that’s been eluding me for months. We write some crazy Javascript at my job, and debugging it in the Windows version of Safari is/has/was/been hell. Following link shows how to turn on the debug menu for the Windows Safari beta.

    http://www.macosxhints.com/article.php?story=20070611144942562

  8. Robert says:

    The biggest problem I have with Safari debugging is the inability to set breakpoints and get stack traces. Is there a Safari debugger that supports this?

  9. ajay says:

    hsxhdshfhdsfhjdsjhhdsjhdshdsjhdsjfhjdfhjsdfhjdshfdsjhfdsjfhdjsfsddscdvx

Leave a Reply

Sponsored Links