Skip to content

Commit

Permalink
Render JSON content as plain text
Browse files Browse the repository at this point in the history
Some website endpoints return information in JSON, which is helpful to
be read as plain text in some situations. The content can still be
downloaded to disk using the save button or the context menu.

An example is the following endpoint https://tls.browserleaks.com/tls,
which provides TLS fingerprinting information in JSON, which will change
when reloading the page (only when Dillo is linked with LibreSSL).

The original page https://tls.browserleaks.com/ uses JS and cannot be
used in Dillo.

See: https://lists.mailman3.com/hyperkitty/list/[email protected]/message/6C5K4F6NBRUDSPNPWTXLQXCK3U3SI7DM/
  • Loading branch information
rodarima committed Jul 14, 2024
1 parent 8f0909b commit de11bf3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ dillo-3.2.0 [Not released yet]
Fix segfault when clicking the "Done" button in downloads dialog.
Add zoom support using Ctrl +/-/0 and the "zoom_factor" option.
Fix wrong redirect by meta refresh without URL.
Display JSON as plain text.
Patches: Rodrigo Arias Mallo

dillo-3.1.1 [Jun 8, 2024]
Expand Down
2 changes: 2 additions & 0 deletions src/IO/mime.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* File: mime.c
*
* Copyright (C) 2000-2007 Jorge Arellano Cid <[email protected]>
* Copyright (C) 2024 Rodrigo Arias Mallo <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -109,6 +110,7 @@ void a_Mime_init()
#endif
Mime_add_minor_type("text/html", a_Html_text);
Mime_add_minor_type("application/xhtml+xml", a_Html_text);
Mime_add_minor_type("application/json", a_Plain_text);

/* Add a major type to handle all the text stuff */
Mime_add_major_type("text", a_Plain_text);
Expand Down

0 comments on commit de11bf3

Please sign in to comment.