Tony França <[email protected]> writes: > The problem was with my responses' content types, > see > http://dicasdolampada.wordpress.com/2014/10/29/how-to-make-librejs-like-you/, > 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. Loic > On Mon, Nov 3, 2014 at 12:54 PM, Richard Stallman : <[email protected]> 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 > www.fsf.org www.gnu.org > Skype: No way! That's nonfree (freedom-denying) software. > Use Ekiga or an ordinary phone call. > >
