F-Script Anywhere turns any Mac app into a smalltalk-y environment: You're able to click on any view to learn its type, and you can send messages to every object in the program at run time. It's very useful to get around in Chrome: If you're wondering which piece of code is responsible for the findbar, you'd just click the findbar and get the name of the class that implements it. Put that in http://cs.chromium.org, and you're done. This page explains how to install and use F-Script Anywhere.
Click "Chrome->Services->Inject F-Script into application". Note: This won't work for programs that are running in gdb (e.g. it won't work in Chromium if you started it through Xcode).
Alternatively, you could do it right from gdb (the Service is an Automator script that runs gdb for you, and there are several Automator scripts floating around, some of them don't work):
>gdb --args ./out/Release/Chromium.app/Contents/MacOS/Chromium (or wherever it is)
(gdb) p (char)[[NSBundle bundleWithPath:@"/Library/Frameworks/FScript.framework"] load]
(gdb) p (void)[FScriptMenuItem insertInMainMenu]
When it's done, an "F-Script" menu entry will appear in the top level menu:
Click "Open Object Browser". In the window that opens, click "Select View". Say you're wondering which class implements the Omnibox, so click the Omnibox next. F-Script Anywhere will tell you that the Omnibox is an AutocompleteTextField.
You can even send methods to this object: Type "sethid" into the search box in the upper right corner, and then click "setHidden:" on the right:
For Developers >