Show Process ID of Individual Web Page Tabs & Windows in Safari for Mac OS X
Anyone who develops just about anything for the web knows that following resource usage of a specific tab or window, or just tracking down an errant tab or window can be difficult, but Safari on the Mac has a hidden trick up it’s sleeve that makes it much easier; the ability to show web process IDs directly within the page and tab title of a Safari window.
This optional setting is aimed at advanced users and developers who have a reason to quickly see an individual webpage PID directly in a window title bar. For everyone else, it may be kind of useless, and a more user friendly approach is available in new versions of OS X, which allow users to see the URL of errant tabs and windows using a hover trick within Activity Monitor.
To gain the page title PID, you’ll need to show the Safari Debug menu if you haven’t done so already – yes, the Debug menu is different from the standard Developer menu. The Debug menu must be enabled through the command line with a defaults string, enter the following line into the Terminal to do that:
defaults write com.apple.Safari IncludeInternalDebugMenu 1
Relaunch Safari and you’ll find the “Debug” menu is now visible, now to enable the PID Page Title visibility option just do the following:
- Pull down the newly visible Debug menu and go to “Miscellaneous Flags”
- Select “Show Web Process IDs in Page Titles”
The change is immediately and you’ll instantly see a process ID alongside a web page title for every open browser window and tab, look for something like this: “Page Title [WP 8418]” with the WP ##### being the Web Process ID.
In case you were wondering or it wasn’t obvious, these are standard process IDs, which means you can easily trace them and their activity, and that you can impact with the kill command, so you can easily suspend the processes of tabs and windows, or kill them if they’ve gone out of control or have otherwise become resource hogs.