money & guns

moneyandguns.com header image 2

Firefox vi/emacs Modes and Real Time Filtering

May 15th, 2008 · 1 Comment

I just had an idea worthy of writing down and rather than put it in that long text file with my other ideas that I never look at, I’m throwing it up here in case anyone with more time and programming experience stumbles on it and decides to implement it (because I never will).

The idea is this:  write a Firefox plugin that allows users to enter a vi- or emacs-like mode (can be context sensitive or not) that allows them to perform rapid filtering and modification of the currently diplayed mode (via the same types of text transforms as are possible in powerful text editors plus more).  Obviously, a browser is not an editor so the exact set of operations possible is probably not useful.  However, the internet can be more interactive–and I see no reason it shouldn’t be.

For example, imagine being able to, at a keystroke or two, display all the links in a web page while removing all the rest of the text (even displaying information about each link with it), toggle all images in a page on and off, or   While, with a few more keystrokes being able to remove all paragraphs that don’t refer to your dog, or highlight every reference to George Bush that occurs in a paragraph that also talks about cheese fries.  Since the plugin would likely be implemented using rewrite rules of the page source, web developers could use it to view modifications on the fly.

Complicated filters could be tested on the fly using regexes and/or lisp-like constructs. Reversing them would only take a single key stroke. A buffer could store past commands for editing. These commands would preferably be displayed in the address bar. Adding functionality to the address bar would be as simple as entering mode, setting hooks, and exiting mode. Aliases can be used in the address bar. These can be saved for future use once they are honed and either auto-loaded, called up by context, or only loaded manually. A hook can be set to automatically turn certain websites obnoxious colors to remind the user not to linger there too long. Pages containing java applets can gracefully remove them and insert images of serene landscapes rather than ugly “download plugin” boxes or (even worse) the applets themselves. If a basic version of the plugin were actually built into Firefox, it could download your customizations and temporarily apply them to your session no matter which computer you were on as long as it was running a new enough version. You get the idea.

Although some of the stuff I mentioned can be done by saving and modifying the page source and re-opening it locally, this is poor for several reasons.  Firstly, it requires knowledge of various web programming standards and protocols.  Second, it probably requires (except in simple cases) deep code inspection which is time consuming.  Third, it’s slow, etc.  Having a plugin do the work requires no knowledge of how web pages are made.1 Some of this stuff can also be done with current keyboard shortcuts. These shortcuts are limited and can be made even faster if multiple shortcuts are to be chained by reducing them to one-key-each commands while in mode.

There are definitely much better and useful ways of using such a plugin than what I’ve come up with. It’s time that web pages are easily manipulable by the user in ways that even the page designer didn’t imagine. An easy to use (for simple tasks) yet powerful (for complex tasks) interface for achieving this similar to the one I described is needed.

1.This is at the expense of learning to use the plugin, however the plugin could be made to handle web pages regardless of how they’re made, while the user still only has to learn one new way of interacting with a computer.  In addition there could be several ways of interacting with the plugin, which are similar to ways people already use, such as vi- or emacs-style hooks and lisp type stuff.  And any new way of writing web pages can be “taught” to the plugin while the user might never even know about it.

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Google
  • Technorati

Tags: uncategorized

1 response so far ↓

Leave a Comment

Del.icio.us