[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: Richard Stallman
Subject: Re: [Help-librejs] Should LibreJS be allowed to change contents of http requests?
Date: Tue, 04 Nov 2014 23:56:40 -0500

[[[ 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. ]]]

  > AJAX returning json as application/json or the like will not get
  > analyzed by the HTML parser, and so it won't break. However many people
  > will always return the wrong mimetype, and in order to have LibreJS
  > function optimally, I think we will need to improve the "content
  > sniffer" part of LibreJS to determine what a response is _really_,
  > regardless of the content-type name.

Maybe so, but here is a crucial point:
DO NOT treat AJAX responses the same as pages!

An AJAX request response might be JSON.  A page won't be.
Thus, the check "is this really JSON" should be done on AJAX responses
but not on pages.

  >  Another technique would be to
  > analyze the content of the response, make modifications to the document
  > structure if needed, but instead of serializing the result back, to use
  > a search/replace or diff algorithm to use the original response and
  > update it.

That sounds like a good plan, but since it will take more work,
I suggest implementing the first solution right away
and putting the second on the TODO list.

Dr Richard Stallman
President, Free Software Foundation
51 Franklin St
Boston MA 02110
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]