HTML: Browser features

This page contains information about how to:
  • customize your browser,
  • see the source-code of web-pages (and thus learn more about web-design),
  • "instruct" the browsers to handle files of various formats (i.e., MIME-types), instead of saving them on disk and leaving the work to you.

    NOTE:

  • The following details are specific to Netscape, but most likely all web-browsers have similar features.
  • Another useful browser on Unix/Lynux is "Lynx" (it can be invoked in a shell by the command lynx). Lynx can be used in a text-only window. It does not display pictures. Hence it is faster, but a bit cumbersome when dealing with frames and tables. One can arrange that the Netscape bookmarks be available in Lynx (and the other way around).
  • GNU Emacs also has a browser-simulator, called w3. The package is available by anonymous ftp from ftp://ftp.xemacs.org/pub/xemacs/emacs-w3/.

    Customization

    The "Preferences" of Netscape are under the "Edit" menu.
    A few things that you might want to change on Netscape are:

    Other web pages

    MIME types

    MIME (Multipurpose Internet Mail Extensions) extends the format of Internet mail to allow non-US-ASCII textual messages, non-textual messages, multipart message bodies, and non-US-ASCII information in message headers. You can find more details at, e.g., http://www.webmaster-toolkit.com/mime-types.shtml or http://www.oac.uci.edu/indiv/ehood/MIME/ (which might not be complete documents).

    The system-wide file extensions to MIME type mapping are in the file /etc/mime.types. You can check /etc/mailcap for the system-wide file. (Information correct as of May 2003, and not available on all machines.)

    Roughly speaking, it works as follows: when the browser receives a file (e.g., a HTML code, or an image, maybe an audio file), the "sender" (i.e., the server) will first sent a message describing the content of the file. The "receiver" (i.e., the client), will look for the appropriate "software" (i.e., application) to handle that type of file.

    Often this type of information is inferred from the suffix in the name of the file (e.g., a file called house.jpg is expected to be an image in JPEG format, whose MIME type is image/jpeg and is handled by Netscape). You can see the MIME-types that Netscape is aware of by looking at "Applications" under the "Navigator" choice in the "Preferences" list.

    Notice that there are many types that come with "Unknown: Prompt User". When Netscape receives such a file, it will ask you what to do with it (open it with a software of your choice, save it on the disk, etc.).

    When the browser wants to save a file on the disk, it will ask your confirmation. Most likely you are also being told the MIME-type at the incoming file, which is often enough to adjust the browser as described below.

    If you want to "instruct" the browser how to handle a MIME type, you can either edit its "Applications" list, or add this information to the file ~/.mailcap in your home directory (note: either approach will modify this file). This file is the standard place in Unix/Linux for this kind of information, and many programs will read it.

    Example: a common format for math papers is DVI (produced from TeX). The relevant MIME information about it is:

    On Unix or Linux the DVI files are handled by xdvi. Thus, you should put this in the "Application:" field of the "Handled by" area (be sure to check all the relevant boxes). To be precise, you should put xdvi %s, where %s, the argument passed on to xdvi, will be the replaced by the name of the file (the browser takes care of this; normally it will save the file in /tmp, with a very long and meaningless name).
    You can try this on the Article math.NT/0009046 from arXiv (this is an e-print arXiv of physics, mathematics, and computer science, maintained at Los Alamos). You have the choice of dowloading the paper in various formats, including DVI.