Added option to scan full web page for favicons

This commit is contained in:
M66B
2022-02-17 09:48:47 +01:00
parent 50687d5da9
commit 00d5253c41
8 changed files with 78 additions and 32 deletions

View File

@@ -54,6 +54,15 @@ public class JsoupEx {
}
}
static Document parse(InputStream stream, String charset, String baseUri) throws IOException {
try {
return Jsoup.parse(stream, charset, baseUri);
} catch (OutOfMemoryError ex) {
Log.e(ex);
return Document.createShell("");
}
}
static Document parse(File in) throws IOException {
try (InputStream is = new FileInputStream(in)) {
return Jsoup.parse(new FilteredStream(is), StandardCharsets.UTF_8.name(), "");