PocketWeb

 

Introduction

PocketWeb (initially called NewtonWWW) is a Web browser developed by TecO. It is the first Web browser for the Newton platform and also the first Web browser for a mobile device. Because the Newton OS did not have TCP/IP support at that time, the browser works by dialing a computer that is connected to the Internet and is running a special program (a proxy server) that downloads Web pages and sends them to the Newton. TecO made a proxy server for Unix and Mac OS. The included description of the Newton-to-proxy protocol used in PocketWeb (the newton-prot.h file in the Unix source code) enabled me to develop my own proxy server for Windows.

The last version of PocketWeb released was 2.4d in 1997. It runs on OS 2.1 and uses NIE, so it doesn't need a proxy. (It can however connect to a "PDA proxy" through the Internet to convert pictures, but the documentation needed to implement such a proxy was never released.) This page focuses on NewtonWWW 1.1, the earliest known version released, and 1.9, which is the last version that will run on OS 1.x.

In February 2012, I contacted TecO and asked them whether they could release the source code to PocketWeb, as I was interested in continuing its development. They answered that they wouldn't have a problem with that, but they couldn't find it and suggested I contact Markus Lauff, who seemed to be the leading developer of the project. He said he couldn't find the source code either. So now the only way to enhance PocketWeb is to make a really good proxy server to make rendering pages easier for it, to allow PocketWeb to display documents of other types than the ones supported (my proxy server already does these two), and to retrieve documents from protocols other than HTTP, such as Gopher, or to develop patches for it, which requires reverse engineering, but is not impossible.

My own proxy server for NewtonWWW 1.1 and PocketWeb 1.9

I started writing my own proxy server (for now called simply PWproxy) in November 2011. It can currently connect to the Newton through a direct serial connection (which makes it useless for practical use, but it's a start) and retrieve HTML and plain text documents, as well as pictures. It also optimizes HTML pages (which TecO's proxy doesn't) by omitting unsupported HTML elements (such as STYLE, SCRIPT, etc.), removing unnecessary whitespace and comments, and replacing some unsupported HTML elements with supported ones, so for example NewtonWWW/PocketWeb gains primitive table support. The optimization can reduce pages to as low as 20% of their original size. It doesn't however implement caching yet, which TecO's proxy does.

PWproxy depends on two free programs to work; Wget to download pages and ImageMagick (optional) to convert pictures to PBM, which is the only picture format that PocketWeb understands. Please read the readme file before running PWproxy so you can configure it properly.

Remember that PWproxy is in no way complete. It does not always work correctly and may freeze or crash both itself and the Newton. While I haven't experienced any damage because of it, use it at your own risk.

Download PWproxy beta 2 for Windows

Note: development of PWproxy is temporarily on hold.

Papers and announcements

Here are some papers and announcements about NewtonWWW/PocketWeb from "back in the day":

Technical details about NewtonWWW 1.1 and PocketWeb 1.9

For the curious, here are miscellaneous things I have discovered about NewtonWWW 1.1 and PocketWeb 1.9.

Supported Newton devices

NewtonWWW 1.1 should run on any OS 1.x Newton.

PocketWeb 1.9 should run on any OS 1.x Newton, or at least any OS 1.3 Newton, but it doesn't seem to. I know it runs on a MP120, but not on a MP110. The reason is unknown so far.

Supported HTML elements

NewtonWWW 1.1: A · B · BR · EM · H1 · H2 · H3 · H4 · H5 · H6 · H7 · HR · I · IMG · ISINDEX · LI · OL · P · STRONG · SUB · SUP · TITLE · U · UL

PocketWeb 1.9: A · B · BASE · BR · DIR · EM · FORM · H1 · H2 · H3 · H4 · H5 · H6 · H7 · HR · I · IMG · INPUT (CHECKBOX, HIDDEN, RADIO, RESET, SUBMIT, TEXT) · LI · MENU · OL · P · PRE · SELECT · STRONG · SUB · SUP · TEXTAREA · TITLE · U · UL

Note: H7 is not a valid HTML element, but if you examine the packages (for example with ViewFrame), you can see it's really there. It renders the same as normal text.

Supported character encodings and entities

Both versions expect all documents to be encoded in ISO 8859-1.

NewtonWWW 1.1 only supports the character entities needed for German: uuml · auml · ouml · Uuml · Auml · Ouml · szlig

PocketWeb 1.9 supports the following 100 character entities, as well as numeric character references (&#):

AElig · Aacute · Acirc · Agrave · Aring · Atilde · Auml · Ccedil · ETH · Eacute · Ecirc · Egrave · Euml · Iacute · Icirc · Igrave · Iuml · Ntilde · Oacute · Ocirc · Ograve · Oslash · Otilde · Ouml · THORN · Uacute · Ucirc · Ugrave · Uuml · Yacute · aacute · acirc · acute · aelig · agrave · amp · aring · atilde · auml · brvbar · ccedil · cedil · cent · copy · curren · deg · divide · eacute · ecirc · egrave · eth · euml · frac12 · frac14 · frac34 · gt · iacute · icirc · iexcl · igrave · iquest · iuml · laquo · lt · macr · micro · middot · nbsp · not · ntilde · oacute · ocirc · ograve · ordf · ordm · oslash · otilde · ouml · para · plusmn · pound · quot · raquo · reg · sect · shy · sup1 · sup2 · sup3 · szlig · thorn · times · uacute · ucirc · ugrave · uml · uuml · yacute · yen · yuml

Test documents

NewtonWWW 1.1 contains a number of HTML documents and pictures, which are accessible in demo mode.

PocketWeb 1.9 contains some HTML documents and bitmaps (in PBM format) that were apparently used to test the browser during development. These files are presented here exactly as they are in the package, with dead links and missing pictures.

DisARM function

PocketWeb 1.9 includes a function called DisARM, which disassembles ARM code. It takes three parameters; a binary object containing the machine code, an offset, and a length. It produces an |evt.ex.fr| exception when it finishes, and doesn't seem to support all opcodes; sometimes "***" appears in place of the instruction mnemonic.

The protocol used by NewtonWWW 1.1

NewtonWWW 1.1 uses a different, much simpler protocol than PocketWeb 1.9. Here is what I understand about it through reverse engineering; this only covers the protocol needed for serial connection.

The connection, like in PocketWeb 1.9, runs at 9600 baud with 8 data bits, 1 stop bit, no parity, and with hardware flow control.

The browser sends a command at any time. There are two commands.

The server command requests a HTML document or PBM picture. It is followed by two spaces, the URL, a space, " -i" in the case of a PBM picture, and terminated with a CR character. In the case of a HTML document, the proxy sends the document, terminated by a EOT character. In the case of a PBM picture, the proxy sends "<akim>", the width in ASCII, a space, the height in ASCII, a space, the bitmap in hexadecimal format, and an EOT character. For example, <akim>8 8 55AA55AA55AA55AA followed by an EOT character would show an 8×8 checkerboard pattern. Due to a bug, the dimensions are not always reliably processed, so it is only safe to send pictures not larger than 99×99 pixels.

Note: the currently available version of PWproxy does not support pictures for NewtonWWW 1.1.

The exit command tells the proxy to disconnect. It appears to be sent only if a server command has already been sent and the document has not yet finished arriving. For some reason, this command is sent twice.

Easter egg in NewtonWWW 1.1

When the status bar says "Click on underlined words to follow a link" (you can force this by tapping somewhere in the text, but only if the page contains hyperlinks), tap it and it will change to "Greetings to my honey Elke…".


First published on .
Last updated on .

Table of contents

Contact me