소스 검색

LibWeb: Add support to view JSON.

Extremely small change, all I did is check for application/json,
mime type and parsed it as text.
aabajyan 4 년 전
부모
커밋
8560108717
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      Userland/Libraries/LibWeb/Loader/FrameLoader.cpp

+ 1 - 1
Userland/Libraries/LibWeb/Loader/FrameLoader.cpp

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