Enabling Developer Extras in HTMLViewer

After doing a lot of research, I found the answer to enabling the Web Inspector on an HTMLViewer object on Mac. For whatever reason, Apple (or WebKit) decided to change the key used to enable the inspector. It used to be WebKitDeveloperExtras. Today it’s WebKitDebugDeveloperExtrasEnabled. Ugh!

To enable the Web Inspector in your app, you would need to run the following in Terminal:

defaults write <your-bundle-identifier> WebKitDebugDeveloperExtrasEnabled -bool YES

This command adds the key/value to your application’s ~/Library/Preferences/*.plist file. Any subsequent launches of the app (on that computer) will have the “Inspect Element” contextual menu option available for your embedded web views.

2 Likes