10.4: Allow space bar scroll from Safari RSS search field

Aug 19, '05 09:11:00AM

Contributed by: loveispenguins

Tiger only hintI love Safari's RSS reader, but it was really bugging me that when an RSS page loads, Safari immediately puts the focus on the search field and essentially blocks scrolling the page using the space bar.

So I looked through the page source and found a way to add this functionality. If you follow these directions, Safari will test to see if a space is the first key entered into the search field. If it is, Safari blocks it from the search field and instead scrolls the page down (or up if Shift is being held). If there is other text in the search field, then space will work normally.

To make this modification, edit the following file: /System -> Library -> PrivateFrameworks -> SyndicationUI.framework -> Resources -> Articles.js. Within that file, search for function handleScrollKeys. This will jump you to the function that handles key capturing when the search field is active. Add the following test case somewhere before default: and after a previous break; line within the function:

case "U+000020":
  if (document.getElementById('searchfield').value.length != 0) return;
  if (event.shiftKey) scroller.scrollByPages(-1);
  else scroller.scrollByPages(1);
  break;
When saving the file, you will likely need an administrator's password. You won't need to restart Safari; just reload any open RSS pages to see the change.

[robg adds: I tested this one, and it worked. I couldn't, however, do the edits in TextEdit without changing any permissions; TextEdit won't overwrite the file, given its permissions. You'll either have to use an editor that can do such things (BBEdit), or (my choice) use the Terminal and sudo with your favorite text editor.]

Comments (12)


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