Skip to content

Commit

Permalink
feat(aio): temporarily add debugging code for google crawler (angular…
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorMinar authored and Zhicheng Wang committed Aug 11, 2017
1 parent db67902 commit 332ae71
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions aio/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,31 @@
<!-- End Google Analytics -->

<script>
window.onerror = function (message, url, lineNo, colNo, error) {
let container = document.createElement('div');

container.style.color = 'red';
container.style.position = 'fixed';
container.style.background = '#eee';
container.style.padding = '2em';
container.style.top = '3em';
container.style.left = '1em';

let msg = document.createElement('pre');
msg.innerText = [
'UA: ' + window.navigator.userAgent,
'Message: ' + message,
'URL: ' + url,
'Line: ' + lineNo,
'Column: ' + colNo,
'Stack: ' + (error && error.stack)
].join('\n');

container.appendChild(msg);

setTimeout(function() {document.body.appendChild(container)}, 0);
};

if (window.document.documentMode) {
var script = document.createElement('script');
script.src = 'generated/ie-polyfills.min.js';
Expand Down

0 comments on commit 332ae71

Please sign in to comment.