The Pug Automatic

View source from Firefox with TextMate

Written September 28, 2006. Tagged OS X, TextMate, Firefox.

I figured I should briefly write up how to configure Firefox to view a page's HTML source using TextMate rather than the built-in Firefox source viewer, since googling it didn't turn up anything useful.


Install the ViewSourceWith extension.

Restart Firefox to complete the installation.

Open the ViewSourceWith settings by going to Tools > Add-ons and double-clicking ViewSourceWith.

[ViewSourceWith settings]

On the "Main" tab of the settings, by the "Editor list", click "New".

In the pane that appears, input this:

Editor path: /usr/bin/open Description: TextMate Parameters: -a "TextMate" $f

[ViewSourceWith editor pane]

If you installed the mate command line utility with TextMate, you could optionally do this instead:

Editor path: /usr/bin/mate Description: TextMate Parameters: $f

[ViewSourceWith editor pane]

Settting the editor path to /Applications/ will, for whatever reason, open a new TextMate in the dock for every sourceview.

Confirm those settings.

If "Use in place of native message/page source menu item" is checked in the "Advanced" part of the settings, TextMate will replace the built-in source viewer. Otherwise, TextMate will be an option in View > Source With. You might need to restart Firefox for changes to this value to kick in.

[ViewSourceWith advanced settings]

All done!