maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N810 (https://talk.maemo.org/forumdisplay.php?f=28)
-   -   Force browser to Parse XML as HTML (https://talk.maemo.org/showthread.php?t=19977)

DaveRo 2008-05-11 16:54

Force browser to Parse XML as HTML
 
I am on a sailing boat in the islands around Greece in the Mediterranean. For internet (particularly weather forecasts) I am using a Greek mobile phone service which is intended for WAP (it's called Wind Plus non-stop). I have both a laptop (Linux + Firefox) and a Nokia N810 - both using a Nokia N70 phone as a modem. I use the Nokia N810 in preference to the laptop because it uses little power - important on a boat.

The mobile service requires me to use an HTTP proxy. I'm not sure exactly what this proxy does but one effect is to mangle the XML code for sites which use XHTML. Firefox (laptop) and MicroB (N810) just give an XML parsing error. This applies to very many sites - this forum for example.

This is a known problem amongst Greek geeks and their work-round, apparently, is to use Opera which has a 'reparse as HTML' facility.

I have part-solved this in Firefox on the laptop by using the Force Content Type addon. I change all content from application/xhtml+html (which causes gecko to parse XML) to text/html. ('Part solved' because although I can now display XHTML sites but some of them don't work: eg. I can view but cannot update my own wordpress blog.)

So there are, I think, 3 possible solutions on my N810:
- use Opera. Can I do that?
- implement a 'reparse as HTML' facility in MicroB, like Opera has
- implement the Force Content Type addon. It that easy?

Any comments welcome. At the moment the laptop is usable but the N810 is not.

Benson 2008-05-11 17:39

Re: Force browser to Parse XML as HTML
 
Yes, Opera (from previous OS releases) has been coaxed to run on OS2008; it's not trivial, and it's not the same as Opera on the desktop, so it might not even help. There's a thread around here on it.

The others are substantially harder, but at least you know they'd work.

One other possibility is to use some other proxy to reformat web pages (e.g. the ones listed here). I don't know that any of those will be satisfactory; while they will probably recast it as html, they specialize in mucking with the content, too. :(

m_stolle 2008-05-11 19:20

Re: Force browser to Parse XML as HTML
 
How about just saving the page, changing the extension to .html (if it's not already) and then open the the file? Since the file doesn't come with an incorrect HTTP header, that might work. Although this doesn't help much for "browsing around", it might help in getting weather reports (as you can do it for the pages you need)

Martin

iamthewalrus 2008-05-11 19:47

Re: Force browser to Parse XML as HTML
 
It seems to me that the mimetype should be changed to text/html. Could a local proxy do that maybe? We already have Privoxy.

Benson 2008-05-12 00:01

Re: Force browser to Parse XML as HTML
 
Yes, that would probably work.

DaveRo 2008-05-12 04:40

Re: Force browser to Parse XML as HTML
 
Thanks for all the replies.
Quote:

Originally Posted by m_stolle (Post 180480)
How about just saving the page, changing the extension to .html (if it's not already) and then open the the file?

Yes, that should work. In fact, that's what I was doing on the laptop before I discovered the Force Content Type addon.

But it's remarkably tedious - even on a laptop with a mouse and with all the normal linux facilities for renaming files and dragging them into the browser.

I was hoping for something easier. It doesn't need all the facilities of Force Content Type - All it needs is to change the content type of every input site to text/html. I would have thought a few lines of userchrome would do it - but I'm guessing.

[I would normally discuss that on Mozilla usenet but this proxy doesn't allow NNTP - and nobody will take any notice if I post with GoogleGroups - even if that works :-( ]

DaveRo 2008-05-12 13:07

Re: Force browser to Parse XML as HTML
 
Quote:

Originally Posted by DaveRo (Post 180643)
Quote:

Originally Posted by m_stolle (Post 180480)
How about just saving the page, changing the extension to .html (if it's not already) and then open the the file?

Yes, that should work. In fact, that's what I was doing on the laptop before I discovered the Force Content Type addon.

Actually, it doesn't work. What I was doing in Firefox was viewing the source of the page and saving that. IFAICS there is no view source (ctrl-u) in MicroB.

If you save the webpage, and view the disk file in MicroB, you just see the XML parsing error message.

briand 2008-05-12 13:23

Re: Force browser to Parse XML as HTML
 
perhaps you can grab the page(s) with wget, then rename them to .html, and then feed them to microb...

iamthewalrus 2008-05-12 14:58

Re: Force browser to Parse XML as HTML
 
It seems not too hard to do with Privoxy. Override the http content-type header for selected domains:.

Info on setting up privoxy on the Tablets can be found here.

DaveRo 2008-05-12 16:05

Re: Force browser to Parse XML as HTML
 
Quote:

Originally Posted by iamthewalrus (Post 180764)
It seems not too hard to do with Privoxy...

OK Thanks. I'd not heard of Privoxy - I'll give it a try.

Fortunately many of the weather sites work OK - they're rather simple. But most forums, blogs, and newspaper sites seem to use content type application/xhtml+xml and they don't work.


All times are GMT. The time now is 15:30.

vBulletin® Version 3.8.8