Using Web Inspector developer tool with Safari
Posted on 5th February 2009 in Browsers, Developer tools | 3 Comments »
Even though Safari makes a perfect platform for web development due to the strict standard policies practiced by WebKit core developers, you still can’t do without developer tools on it. While Mozilla Firefox has a superb Firebug extension, WebKit has Web Inspector.
UPDATE: now you can just go to Preferences > Advanced and tick the Show Develop Menu in menu bar checkbox:
![]()
Many thanks for this to Mark Rowe from Apple!
For past WebKit nightlies Web Inspector was turned on by default. But from some point developers decided to turn it off for regular users so there’s a bit of configuration you’ve got to get done now (it also concerns Safari 3 users):
- Open Terminal from Applications > Utilities
- Type in a command to activate Web Inspector:
defaults write com.apple.Safari WebKitDeveloperExtras -bool true
- Restart Safari/WebKit
- Right-click on a page somewhere and choose Inspect Element
- Web Inspector will start up. You can locate the scope of your clicked element within the code, CSS definitions on the right side and a Console button in the bottom-left corner of the Inspector (the one highlighted on the image below):

- If you’ve got it all right, Web Inspector should look like this (click to zoom):



3 Responses
You do not need to jump through “defaults write” hoops to use the web inspector. As I mentioned in the bug report that you filed about this on webkit.org you can simply enable the inspector by ticking the “Show Develop menu in menu bar” from the Advanced pane of Safari’s preferences.
Thanks for the notice Mark and update in there!
[...] Using Web Inspector developer tool with Safari [...]