I have an html content which when loaded to the webview throws some warnings in console. Is there any way to capture and compare these warnings to perform specific actions for specific warning in javascript.
-
In Javascript, you can only catch errors, not warnings. Warnings are Browser based only.Koby Douek– Koby Douek2017-05-14 10:08:55 +00:00Commented May 14, 2017 at 10:08
-
Possible duplicate of detect all JS errors, using JSDouwe de Haan– Douwe de Haan2017-05-14 10:23:44 +00:00Commented May 14, 2017 at 10:23
-
The scenario is as follows, I have an html content for which the associated fonts are not proper hence when i load the content in the webview it throws some warnings saying invalid version tag. Is there any way where i can get to know that the fonts are not valid so that i can add some default style over the page.Midhun Kumar– Midhun Kumar2017-05-14 18:05:11 +00:00Commented May 14, 2017 at 18:05
Add a comment
|
1 Answer
Since console warning do not originate from Javascript itself, but from the browser, Javascript does not interface catching warnings, only errors.
3 Comments
Midhun Kumar
the scenario is as follows, I have an html content for which the associated fonts are not proper hence when i load the content in the webview it throws some warnings saying invalid version tag. Is there any way where i can get to know that the fonts are not valid so that i can add some default style over the page. Else is there any way we can check the font files for valid fonts or not.
Koby Douek
what is the exact warning text?
Midhun Kumar
Failed to decode downloaded font: file:///storage/emulated/0/book/9789531421508/OEBPS/font/Archer-Book.otf HYGGE-6.xhtml:1 OTS parsing error: invalid version tag