I am building a browser with geckoview and want to catch some javascript errors that popup in the console. These errors are printed by “GeckoConsole” and “Web Content” tag in the log but I can’t find a way to catch them. None of the Gecko delegates seem to catch these errors.
Here is an example error that is pronter in the log that I want to catch.
GeckoConsole E [JavaScript Error: “Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at “ADDRESS”. (Reason: CORS request did not succeed). Status code: (null).”]
Web Content E [JavaScript Error: “NetworkError: FetchEvent.respondWith() Promise rejected”]
Tried all possible delegates that geckoview provides to help catch errors but none seem to catch these errors. Tried finding where “GeckoConsole” prints from to maybe catch there but couldn’t find it.
Remy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.