How can I improve/replace View Source in Safari?
BetterSource



It's similar to the view source in Chrome in a lot of ways:


It has syntax highlighting and line numbers
It's opened in a tab instead of a window
Uses the default monospace font specified in preferences instead of Monaco 12


Limitations:


Line numbers are included in selections
The source view cannot be opened with a shortcut
Takes slightly longer to appear than the normal source window




Setting a default zoom level in a custom style sheet

The custom style sheet you can specify in the Advanced tab of the preferences also affects the view source window. I don't know how to target it specifically, but this would apply a default zoom level to both it and website content:

body { zoom: 125%; }




view source in TextMate.scpt

tell application "Safari" to tell document 1
    repeat 100 times
        if (do JavaScript "document.readyState") is "complete" then exit repeat
        delay 0.05
    end repeat
    set src to source
    set u to URL
end tell

try
    tell application "TextMate"
        open POSIX file u
        activate
    end tell
on error
    set f to do shell script "f=`echo " &amp; quoted form of u &amp; " |
    sed 's|.*://||;s|/$||;s|:|-|g;s|/|-|g'`; echo \"/tmp/view-source-$f.html\""
    do shell script "/bin/echo " &amp; quoted form of src &amp; " &gt; " &amp; quoted form of f
    set f to POSIX file f
    tell application "TextMate"
        activate
        open f
    end tell
end try