1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:08:11 +00:00

LibWeb: Add support to view JSON.

Extremely small change, all I did is check for application/json,
mime type and parsed it as text.
This commit is contained in:
aabajyan 2021-03-20 18:46:22 +04:00 committed by Andreas Kling
parent 31f7296934
commit 8560108717

View file

@ -140,7 +140,7 @@ bool FrameLoader::parse_document(DOM::Document& document, const ByteBuffer& data
}
if (mime_type.starts_with("image/"))
return build_image_document(document, data);
if (mime_type == "text/plain")
if (mime_type == "text/plain" || mime_type == "application/json")
return build_text_document(document, data);
if (mime_type == "text/markdown")
return build_markdown_document(document, data);