I'm trying to show/hide the web inspector tool in mac os "Yosemite" using bash script, I used the following command in terminal but it didn't work even after I restarted Safari, so am I doing something wrong?

defaults write com.apple.Safari WebKitDeveloperExtras –Boolean
  • Do you actually just write "boolean" or put a 1/0 there? (defaults write com.apple.Safari WebKitDeveloperExtras 0 or defaults write com.apple.Safari WebKitDeveloperExtras 1) – Kevin Grabher Jul 2 '15 at 10:15
  • I tried commands you added but unfortunately didn't work too – Hazem Hagrass Jul 2 '15 at 10:18
  • Wouldn't it just be easier to hit Cmd/opt/i ? – Tetsujin Jul 2 '15 at 10:18
  • No because I need to write this command in a mac application. – Hazem Hagrass Jul 2 '15 at 10:19
  • how about under NSGlobalDomain ? – Tetsujin Jul 2 '15 at 10:24

defaults write NSGlobalDomain WebKitDeveloperExtras -bool true

adds Inspect Element to the right-click menu

However, opening the Develop menu will do it too

defaults write com.apple.Safari IncludeDevelopMenu -bool true

One additional note about toggling the Develop menu this way is that it isn't interactive with the Safari prefs pane, & can result in reversed behaviour if later toggled from there by the user.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .