In the process of implementing PrettyWeb, I ran into some issues.
Firefox's addon model was a bit odd at first, because I had to learn entirely new concepts like their XUL. I had some help by basing it off of Cloud-to-Butt, which does something like what I wanted to do - perform some filtering on the existing DOM. The difference between the two, though, is that Cloud-to-Butt works only on DOM "text nodes", while I have more specific requirements - the "text nodes" within a
<pre> tag directly below the
<body> tag. This is because Firefox renders plain-text pages inside roughly the following structure:
<html> <head> <link rel="alternate stylesheet" type="text/css" href="resource://gre-resources/plaintext.css" title="Wrap Long Lines"> </head> <body> <pre> Contents </pre> </body> </html>
Because I had the parser (
stmd.js, which was renamed to
The code is available on GitHub.