Get js errors from the site
Reported by
issues.b...@gmail.com,
Aug 25 2017
|
||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36 Steps to reproduce the problem: 1. 2. 3. What is the expected behavior? What went wrong? I try to get js errors from the sites. 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. Did this work before? N/A Chrome version: 60.0.3112.101 Channel: n/a OS Version: 6.1 (Windows 7, Windows Server 2008 R2) Flash Version:
,
Aug 28 2017
Please direct protocol-related questions to https://github.com/ChromeDevTools/devtools-protocol. crbug.com is for devtools as a part of the chromium, not about the protocol. |
||
►
Sign in to add a comment |
||
Comment 1 by issues.b...@gmail.com
, Aug 25 2017My code const CDP = require('chrome-remote-interface'); 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(); } })