[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-librejs] Should LibreJS be allowed to change contents of http

From: Loic J. Duros
Subject: Re: [Help-librejs] Should LibreJS be allowed to change contents of http requests?
Date: Tue, 04 Nov 2014 11:20:21 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Tony França <address@hidden> writes:

> The problem was with my responses' content types, 
> see
> topics (3) and (5).
> Cheers

I don't think my previous email to help-librejs went through and I can't
seem to see a copy. So I thought I'd mention the following again (more
clearly hopefully):

If a JSON reponse is flagged as text/html. LibreJS will parse it as
HTML. But this is still an issue, because many people return responses
with the wrong content types. The HTMLParser class that LibreJS uses
will fill in the blanks, just as it does in your browser when you look
at a page with broken HTML or with no HTML markup. Then it gets
serialized back and sent back to the browser's regular workflow.

A good way to deal with this would be to have a more efficient and
intelligent content sniffer while still being performant enough that it
doesn't take minutes to figure out what the content type really is.

Another way would be to still parse the response as HTML, but if no real
modification has been made by LibreJS (AKA deactivating js elements by
modifying/removing attributes etc, ...), to return the original response
in its pristine condition. If modifications happened, then a
search/replace algorithm could be used to modify the original response
rather than return the serialized html that can be very different from
the original at times.


> On Mon, Nov 3, 2014 at 12:54 PM, Richard Stallman : <address@hidden> wrote:
>     [[[ To any NSA and FBI agents reading my email: please consider ]]]
>     [[[ whether defending the US Constitution against all enemies, ]]]
>     [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
>     Tony's question seems like a good question to me:
>     > I'm not sure I understand everything you said, but what about AJAX calls
>     > that return JSON responses?
>     > Shouldn't librejs leave those responses unchanged?
>     What is the answer?
>     --
>     Dr Richard Stallman
>     President, Free Software Foundation
>     51 Franklin St
>     Boston MA 02110
>     USA
>     Skype: No way! That's nonfree (freedom-denying) software.
>     Use Ekiga or an ordinary phone call.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]