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.
Asked
Active
Viewed 638 times
0
-
In Javascript, you can only catch errors, not warnings. Warnings are **Browser based** only. – Koby Douek May 14 '17 at 10:08
-
Possible duplicate of [detect all JS errors, using JS](http://stackoverflow.com/questions/20534457/detect-all-js-errors-using-js) – Douwe de Haan May 14 '17 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 May 14 '17 at 18:05
1 Answers
0
Since console warning do not originate from Javascript itself, but from the browser, Javascript does not interface catching warnings, only errors.

Koby Douek
- 16,156
- 19
- 74
- 103
-
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. – Midhun Kumar May 14 '17 at 18:04
-
-
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 – Midhun Kumar May 15 '17 at 06:22