Created
November 13, 2016 21:49
-
-
Save mstijak/715fa2dd3f495a98386c3ebbadbabb8c to your computer and use it in GitHub Desktop.
Google Bot Crawl Debugging
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.onerror = function (message, url, lineNo, colNo, error) { | |
console.log(arguments); | |
let container = document.createElement('div'); | |
container.style.color = 'red'; | |
container.style.position = 'fixed'; | |
container.style.background = '#eee'; | |
container.style.padding = '2em'; | |
container.style.top = '1em'; | |
container.style.left = '1em'; | |
let msg = document.createElement('pre'); | |
msg.innerText = [ | |
'Message: ' + message, | |
'URL: ' + url, | |
'Line: ' + lineNo, | |
'Column: ' + colNo, | |
'Stack: ' + (error && error.stack) | |
].join('\n'); | |
container.appendChild(msg); | |
document.body.appendChild(container); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment