thumbnail-zoom icon indicating copy to clipboard operation
thumbnail-zoom copied to clipboard

TypeError: aDocument.defaultView is null

Open garyking opened this issue 11 years ago • 6 comments

TypeError: aDocument.defaultView is null overlay.js:1298 TypeError: aDocument.defaultView is null overlay.js:1596

These errors keep popping up in Firefox Browser Console. The lines show:

if (this._needToPopDown(aDocument.defaultView.top)) {

and

this._currentWindow = aDocument.defaultView.top;

respectively.

To fix, it seems like this can simply be done:

if (aDocument.defaultView && this._needToPopDown(aDocument.defaultView.top)) {

and

if (!aDocument.defaultView) return false;
this._currentWindow = aDocument.defaultView.top;

Perhaps this would also fix the TypeError: can't access dead object overlay.js:1596 as well?

Thanks

garyking avatar Aug 02 '14 20:08 garyking

Thanks; I'll add a version of that workaround.

dadler avatar Sep 02 '14 06:09 dadler

Excellent thanks. As a web developer, it's annoying when the error messages keep popping up in the Browser Console. They don't seem to harm the script's execution, so like I said, it's perhaps best to suppress them somehow.

garyking avatar Sep 02 '14 06:09 garyking

After updating to TZP 3.0, I'm still getting this error, but on different lines I think.

First one:

TypeError: can't access dead object / overlay.js:1299

And line:

if (this._needToPopDown(aDocument.defaultView)) {

Second error:

TypeError: aDocument.defaultView is null / overlay.js:1597

And line:

this._currentWindow = aDocument.defaultView.top;

garyking avatar Sep 18 '14 19:09 garyking

Odd; it's protecting against null defaultView; it must be aDocument itself that's null, but I don't see how that could happen.

Do you know steps to consistently reproduce it?

dadler avatar Sep 19 '14 04:09 dadler

No sorry, I usually am unable to reproduce this consistently. Sometimes I manage to come across a webpage, while doing web dev, where I can refresh it and get the error to appear, so if that happens then I'll post the URL.

garyking avatar Sep 19 '14 04:09 garyking

I can reproduce this issue consistently by pressing ctrl+F5 and holding the buttons down for a while (so that the webpage is reloaded a lot of times in quick succession) on http://www.dota2.com/items/

TypeError: can't access dead object overlay.js:1362:1 TypeError: can't access dead object overlay.js:1362:1 TypeError: can't access dead object overlay.js:1362:1

Might be related to the many images on that page, as other webpages reloaded without any errors. If it doesn't work for you, try a webpage with more images or install (slow) addons like adblock, ghostery, noscript etc. which could interfere.

There's another line where it happens, but I did not find a way to reproduce that: TypeError: can't access dead object overlay.js:1668:5

I'm running TZP 3.8.

Njol avatar May 11 '16 22:05 Njol