This error does not happen in Firefox 4.0 or Internet Explorer 8+.
I create a new empty tab, and open console (Ctrl+Shift+I and then Esc) and paste the following codes:
var cnt = 0;
(function() {document.body.innerHTML = cnt;window.setTimeout(arguments.callee,100);})();
(function(){cnt++;window.setTimeout(arguments.callee,0);})();
Sometimes there is an error at this point but not always.
After this I paste more:
(function(){cnt++;window.setTimeout(arguments.callee,0);})();
After ~30sec I get any of these errors:
Uncaught TypeError: Cannot read property ‘offsetHeight’ of null
Uncaught TypeError: Cannot read property ‘classList’ of null
The question: what is the problem? How can I solve this?
UPDATE:
This error happens when I switch between my opened tabs, but also randomly.
It’s because
chrome://newtabexpects certain elements to be there (for JavaScript purposes) but you’re wiping them out by usingdocument.body.innerHTML. You could inject an element to use for your output instead, something like this should work: