tats/w3m

Ah, if only we could use custom CSS...

Opened this issue · 4 comments

097115 commented

...If only, for instance, we could tell w3m not to display certain parts of webpages! :) Something like Stylish / Stylus extensions, may be with the help of siteconf or a similar configuration file.

(Probably shouldn't post this to Issues but in the absence of Discussions couldn't find a better place, sorry. And just in case: I know we can tie w3m with something like python-readability but it simply doesn't always help.)

Unfortunately, CSS (Cascading Style Sheets) may not be supported on w3m, as the software does not function within a graphical user interface (GUI).

bptato commented

Unfortunately, CSS (Cascading Style Sheets) may not be supported on w3m, as the software does not function within a graphical user interface (GUI).

I disagree. elinks has CSS support, though the number of supported properties appears to be quite low.
My browser Chawan has a CSS-based layout engine, which supports more properties, but lacks optimization (for now it's quite slow compared to elinks).

Also, Browsh exists and IIRC there is a TUI frontend to Chromium as well (that I can't remember the name of).

In general, there are only two major difficulties in getting CSS on a TUI:

  • Quite obviously, you need to use the default monospace font, so you cannot support font-family. I see this as a feature, as I also force a single font in my Firefox installation for consistency.
  • The more serious problem is that you also have to round pixels to cells, which can get ugly. But there are solutions for this, e.g. error correction of y position by grouping lines into one large block (<- Chawan does this) or simply setting 0 !important on some properties (<- Browsh does this, I think). Of course none of these are perfect, but I think in theory we could achieve good enough approximations for most sites, and just fix up the rest with user styles.

In short: it most certainly could be supported, but somebody would have to write the code.

(Probably shouldn't post this to Issues but in the absence of Discussions couldn't find a better place, sorry.

By the way, why doesnt this repo have the "Discussions" ? It's only a click to enable it.

It also happens to me that sometimes, I want to:

  • ask or make a suggestion (not a bug report)
  • share and check out advanced usage tips and integration with other tools
  • check how others are doing stuff X with w3m and see if there is a better/more optimal way
  • etc ...

Since these are not "bugs" at all, and I dont want to "pollute" this repo "Issues" section, I very often just refrain from posting. I just dont want to overload the work and and waste attention effort of the repo committers and maintainers. Their primary effort should be in serious bugs, CVE's etc.

But I sure miss a place on the Internet for advanced, long time users of w3m. Users, not coders or programmers.

Reddit forums, mailing lists just dont cut it for me.

I am not wondering for a place for beginner questions. Or for people who have just bumped into it and are still wandering "Should I use a text browser ? The modern web doesnt work with it !". They have had 30 years to answer that question.

Also not for people who want to ask things like, "Could w3m support javascript ?, it doest work in my favourite site xyz"

rkta commented