Unfocus search field in Safari when browsing RSS feeds

Sep 29, '06 07:30:05AM

Contributed by: webdeck

When you view an RSS feed in Safari, I find it annoying that Safari automatically focuses the Search box. This prevents me from scrolling by hitting space or using my mouse's scroll weel until I click somewhere else first. Of course, if I accidentally click on an article, then I'm taken there, which is even more annoying.

So, to prevent the focusing, you need to edit this file: /System -> Library -> PrivateFrameworks -> SyndicationUI.framework -> Versions -> A -> Resources -> Articles.js.

Open the file in your favorite text editor, and look for the following JavaScript function:

function setupFilter( )
{
    var filterField = document.getElementById("searchfield");
    filterField.focus();
    setFilterString(filterField.value);
    sPrefiltered = (sFilterString != null);
}
Comment out the filterFeild.focus line by putting two forward-slashes at the front of it, like so:
function setupFilter( )
{
    var filterField = document.getElementById("searchfield");
//    filterField.focus();
    setFilterString(filterField.value);
    sPrefiltered = (sFilterString != null);
}
And save the file and restart Safari. No more auto-focus! To restore the auto-focus, just remove the two slashes you added and restart Safari again.

Comments (9)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20060924130906315