
Why browse the Web in Emacs? (2008) - pmoriarty
http://sachachua.com/blog/2008/08/why-browse-the-web-in-emacs/
======
seccess
This covers many of the reasons I prefer web browsing without JS enabled:
speed, less mem usage, safer. Before I started doing so, I thought that
disabling JS would make the internet unusable, but a vast majority of pages
display their content just fine without it. In addition, it is really easy to
add domains to the JS whitelist in Chrome without the need to go into the
options menu every time (less so in FF). AND, Chrome uses separate whitelists
for normal and private browsing, and will clear the private browsing whitelist
when you close the window! There are some periodic annoyances, but I wouldn't
think of going back to default-enabled.

Browsing the web in Emacs is a bit too hardcore for me though :P

~~~
chestnut-tree
_" I thought that disabling JS would make the internet unusable, but a vast
majority of pages display their content just fine without it"_

I also browse the web with Javascript disabled (using Noscript), but have
formed the opposite impression: more and more sites won't display their
content (or display their content incorrectly) if Javascript is disabled. Most
of the sites I'm looking at are not "web apps" or SPAs (single page apps),
they are sites with text articles or links so they have no real reason to
break without Javascript. (It's always annoying when you attempt to click a
link only to find it won't work unless Javascript is enabled.)

The rise of Javascript frameworks is only fuelling this trend of Javascript-
dependent web sites. I've said this before, but Web developers pick the tools
that make their lives easier (as you'd expect), but that doesn't always mean
that users get the best experience.

~~~
chriswarbo
> It's always annoying when you attempt to click a link only to find it won't
> work unless Javascript is enabled.

Ah, the number of times I've asked colleagues to stop doing this! If you want
a JS-powered link/button/whatever on a page, insert it using JS; then you're
guaranteed that it will only show up for those who can use it.

Likewise, all togglable content should begin visible, and selectively-hidden
by JS during page load; that way, it only gets hidden for those users capable
of showing it again.

Also, although this is rarer, all work should be done in small, isolated event
handlers. That way, when some unexpected situation arises (eg. the user is
blocking your chosen spyware platform), that particular handler dies, but all
of the rest keep working (eg. the button handlers, the slideshows, etc.).

~~~
krick
The truth is almost nobody cares about js being disabled anymore. Even if
today you think it's an overestimating (I don't think so anymore) over few
more years it won't be even for you. Just 2 years ago it was like "What if a
customer doesn't have js enabled? We don't want to loose him just over that!
Let's support both versions.", today it is already more like "No js? Weird,
lol. Well, it's his own problem anyway, no reason to spend time&money on that
in 2014.".

When I for some reason was forced to use lynx, which I don't normally do, I
was simply amazed by how smooth browsing is, it doesn't feel like the usual
"internet" anymore, more like navigating your project via text editor on the
local filesystem. But unfortunately as you go further than browsing ArchWiki
it becomes almost unusable due to lack of static (in the sense "no js") sites
support.

~~~
seanp2k2
[http://stackoverflow.com/questions/764624/how-can-you-use-
ja...](http://stackoverflow.com/questions/764624/how-can-you-use-javascript-
in-terminal-for-w3m)

W3m-js is/was a thing. Also, w3m can apparently draw images inline via xterm,
though I wasn't able to get this working in the ~10 minutes I tried on OSX
Yosemite with X11 and xterm using the w3m from homebrew. UZBL is ok too, if
you just want a minimalistic WebKit browser with vim key binds.

~~~
krick
If you want vim-keybinds in your browser you can just use vimperator or
pentadactyl, it's not the point here. Web without pictures/js on today's
connection is almost as smooth as navigating your local file system, while
"normal" browsing isn't, and you (well, _me_ ) don't even notice that before
you eventually try that js-free browsing from lynx or something like that.
That is, it _would be_ if not for the fact that js-free web is a "Red Book
animal" already.

------
bdg
Does anyone remember Gopher:// ?

My experience was that content was a first-class-citizen of the gopher-net,
because we didn't have "hyper media".

~~~
kissickas
Wow, I had never heard of it, but that looks pretty cool. Gopherpedia is a
complete interface to Wikipedia which I'll probably make use of.

Anyone else running Lynx? I don't use it for normal browsing (FF+NoScript like
many others here) but I do fire it up for some of the purposes listed in the
original article - works well with my workflow, no distractions, and of course
it's really safe. Incidentally, it still fully supports Gopher.

On Mac OS, I highly recommend Lynxlet
[http://habilis.net/lynxlet/](http://habilis.net/lynxlet/)

~~~
aruggirello
I used Lynx back in my glorious startup days (12-15 years ago :) it was a
great tool to see what the various crawlers (which were Altavista, Lycos,
Yahoo and Hotbot at the time) were actually "seeing" on the pages of my site.
It helped solving issues with spacing, alt texts...

------
oconnor663
> You’re safe from browser exploits.

I'm skeptical of that. Of course no one is actually targetting whatever
vulnerabilities there are, and getting rid of JS helps a lot. But is all the
code sandboxed or anything?

~~~
technomancy
Given that eww (the latest Emacs web browser) is written in elisp, it's safe
from buffer overflows and such, which are the most common form of
vulnerability in software written in C. The actual parsing code uses libxml,
which isn't elisp, but is one of the most widely-deployed parsers around.

Obviously there's no such thing as perfect security, but I would guess it's
way more difficult to exploit than your conventional browsers.

------
krylon
I use w3m from Emacs all the time. It is not my primary browser, but I do like
it for reading documentation while hacking. It is ridiculously fast and uses
very little memory when compared to Firefox.

It is very convenient for copying snippets of code and pasting them in
whatever file you are editing (or a REPL), too.

The same, to a lesser degree, goes for Dillo. It is amazing how Dillo can have
dozens of tabs open and never use more thant 50-100 MB of RAM... :)

~~~
omaranto
Have you tried eww in Emacs 24.4? I already like it better than w3m.

~~~
username223
It's better once you keep it from messing with your text background color. I
think this does it:

    
    
        (defadvice shr-color-check (before unfuck compile activate)
          "Don't let stupid shr change background colors."
          (setq bg (face-background 'default)))

------
jfb
I think what would be interesting is not in bringing the web to Emacs but
rather Emacs to the web; a web browser that exposed everything right down to
the rendering primitives in a decent (well, better than elisp or Javascript)
language, allowing users to customize how they interact with the web in the
way that Emacs users customize how they interact with text.

~~~
swombat
Firefox is already pretty heavily customisable through XUL and, of course, is
open source so you can modify every aspect of it...

~~~
jfb
I guess XUL is the stumbling block for me there. And of course, the browser
itself can be modified, for which yay! but really I'm looking for a small set
of primitives exposed in a high-level language that can be combined to create
web browsers specific to certain tasks; perhaps something like this could be
retrofitted onto Firefox, in the way that Emacs was an macro-extension of an
existing editor.

~~~
JetSpiegel
Vimperator for Firefox, then.

------
netcan
Customizing something and making it yours is a powerful thing. I think that
ultimately that's the reason. One reason is that you make things uniquely fit
you. But, I think in more cases than we are aware or want to admit, the
emotional reasons are the real reasons. Sometimes its nice to have something
you made, not something that was mass produced for everyone.

"Resource hogging" always seems like such a crazy reasoning. It's more
aesthetic than practicalities. Is your memory really so scarce?

~~~
to3m
There's a line between "use" and "hogging"...

My computer is noticeably slower when Firefox is running. Quite often, Firefox
will grab the audio device and not give it back, silencing all other programs.
Sometimes the fan will just spin up and the computer will sound like a hoover
until I quit it. Over time it just uses up more and more memory, rarely giving
it back. It's not unusual to look at the task list and see Firefox taking up
400+MBytes, even though you're doing very little. (Right now, it's taking up
420MBytes. All I have open is the HN page with this text box I'm typing in.) I
also think it does something rude with the GPU, too - when I'm not running
Firefox, the auto-hide dock pops up perfectly smoothly. When Firefox is
running, though, it stutters as it pops up.

The X11 version is terrible to use over a network too.

(I had a whole different set of complaints about Safari.)

------
PaulHoule
I don't know if Emacs is so secure. Years ago I wrote a virus that would
propagate between files in Emacs lisp.

~~~
technomancy
Years ago, huh? Was it before Emacs added support for whitelisting file-local
variables? These days you can't just place elisp in arbitrary files and have
it get executed.

(Of course, propagating to other elisp files is both easy and completely
orthogonal to Emacs, since you could do it in basically any language.)

~~~
PaulHoule
The same problem happened with Microsoft Word, which, in my mind, is a product
a lot like Emacs. Emacs is written in a special dialect of LISP, Word is
written in a special dialect of Visual Basic. Both have a mind-boggling array
of features, etc.

The difference was the Word viruses got a lot more fame because more people
used Word.

------
dschiptsov

       M-x eww http://www.lispworks.com/documentation/HyperSpec/Front/index_tx.htm

~~~
phaer
The example is well chosen because the Common Lisp Hyperspec is actually nicer
to view in a text browser than in a graphical one ;)

------
hacknat
All she had to talk about was scripting. It is super convenient to be coding
in your language, have another window that is open beside your code that
automatically does your searches on a certain website based on what you have
open in the other window.

~~~
sachac
This is true! I've used keyboard macros with webpages and textareas to save
myself lots of time. =)

------
diziet
A great reason not to do this, if you are building anything that will ever be
touched by end users (or are building anything that is an application on the
web browser) is this isolates you from how real users consume internet
content.

------
Tehnix
From the other comments, I feel more alone in this camp than I thought. I've
taken the stance to not even consider a user, browsing sites I develop, with
javascript off. It's such an integral part of the web by now, and without it,
interactivity doesn't really exist.

Is it really so prevalent to browse without JS (I doubt the casual user would
do that, since they're probably not even aware that JS exists)?

The only reason I'd care about displaying content without JS, is specifically
for crawlers.

~~~
AlisdairO
disclaimer: not a web dev, don't really have a dog in this race.

The reaction here strikes me quite a bit - talk about supporting an old web
browser which has a small market share, and the reaction will often be that
it's a waste of time. No-js users are a miniscule fraction of a typical site's
audience, so why would those sites bother to support them any more than they
would bother to support an old browser?

~~~
rakoo
I believe there's a difference between not supporting an old, non-standard-
compliant browser, where you must have the same functionalities but the
platform is different, and not supporting users who have turned off
javascript, because in this case the functionalities themselves are different.
You almost have 2 different "products" in this case.

Also, angry users are always the most vocal. The huge majority that doesn't
bother (or doesn't even know how to) turning off javascript will not complain
on HN.

~~~
AlisdairO
I guess - from my point of view it would be lumped under the wider group
heading of 'how much should I worry about going to significant effort
supporting stuff that few of my customers will care about?'

------
3rd3
Just yesterday, I tried it the other way around with a terminal emulator in
the browser using FireSSH [1]. However, I’m not sure whether it is
particularily safe to have a SSH connection to localhost in Firefox. It also
needs some key-rebinding to be of any use which I haven’t done yet.

[1]: [http://firessh.net/](http://firessh.net/)

~~~
3rd3
Yeah right, I have no idea why I deserve a downvote.

~~~
3rd3
LOL, are you fucking kidding me…

One of the points of the blog post is that web browsing in Emacs allows you to
integrate browser work and Emacs work, which for me is the most compelling
one. But you can possibly achieve something similar by integrating Emacs into
Firefox via SSH and using for example .js [1] for automatization work. That
way you wouldn’t have the disadvantage that you basically lose most formatting
and layout which are actually quite helpful if you stay away from the loud and
annoying websites. That’s why I thought it was worth mentioning. I also use
Tree Style Tabs and it could be helpful to keep work related websites and
Emacs buffers organized in that way.

[1]: [https://github.com/defunkt/dotjs](https://github.com/defunkt/dotjs)

------
jarcane
It is a dream of mine to do exactly this, but even eww.el just wasn't any good
to actually use. I can do everything else in Emacs, except that, but that's a
pretty big something.

------
platz
elinks is quite useful on a raspberry pi

------
pakled_engineer
No eww.el mention? It comes w/24.4

~~~
Sir_Cmpwn
This article was written in 2008.`

------
joaorj
Quick answer: because you are a masochist

------
stevebmark
Is terrible, this idea.

~~~
solistice
Can you elaborate please?

