Get js errors from the site
See original GitHub issueI try to get js errors from the sites:
CDP(async (client) => {
const {Log, Page, Runtime, Network, Console} = client;
try {
await Network.enable();
await Page.enable();
await Log.enable();
await Log.clear();
Log.entryAdded(({entry}) => {
console.log(entry);
/*if (entry.level === 'error' && entry.source === 'javascript') {
console.log(entry);
}*/
});
await Console.enable();
await Console.clearMessages();
Console.messageAdded(({entry}) => {
console.log(entry);
/*if (entry != undefined && entry.level === 'error' && entry.source === 'javascript') {
console.log(entry);
}*/
})
await Page.navigate({url: url});
await Page.loadEventFired();
//console.log(html);
} catch (err) {
console.error(err);
} finally {
client.close();
}
})
But methods Log.entryAdded
and Console.messageAdded
don’t want to give errors from some sites, for example - crucial.com.au or note.ly
And Console.messageAdded
- just returns undefined.
Perhaps someone knows how to get js errors correctly? Thanks.
Component | Version |
---|---|
Operating system | Ubuntu |
Node.js | Node.js v7.10.0 |
Chrome/Chromium/… | 59.0.3071.36 |
chrome-remote-interface | 0.22.0 |
Is Chrome running in a container? NO
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Using Your Browser to Diagnose JavaScript Errors
Go to the screen where you are experiencing the error. In Chrome, navigate to Tools > Advanced > Error Console. ... The error...
Read more >How to find JavaScript errors with your browser's console?
If you suspect that an issue on your website is caused by a JavaScript error, there luckily is an easy way to check...
Read more >Get all javascript errors on page/javascript error handling
I have mine working with window. onerror and it doesn't stop my javascript: window. onerror = function(error, url, line) { controller.
Read more >How Do I Diagnose JavaScript Errors on My Site?
Open Google Chrome. · Click the “Customize and Control Google Chrome” button at the top right side. · Chrome tools Error Console. From...
Read more >JavaScript errors page: Detect and analyze errors
View JavaScript errors · Go to one.newrelic.com > Browser > (select an app) > JS errors. · Use the available options in the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
According to that thread the solution is using
Runtime.exceptionThrown
and it actually works for me:Thanks for response, for first I created a message on the Google Group