0

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.

3
  • In Javascript, you can only catch errors, not warnings. Warnings are Browser based only. Commented May 14, 2017 at 10:08
  • Possible duplicate of detect all JS errors, using JS Commented 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. Commented May 14, 2017 at 18:05

1 Answer 1

0

Since console warning do not originate from Javascript itself, but from the browser, Javascript does not interface catching warnings, only errors.

Sign up to request clarification or add additional context in comments.

3 Comments

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.
what is the exact warning text?
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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.