Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

window.onresize not firing in Chrome but firing in Chrome Incognito

I would like to ask in what situations could this even be possible? I've got a website with a window.onresize event, works in firefox, IE9, Chrome Incognito windows, but not in Chrome. The thing is, it used to work before I made some unrelated changes to my code, or before I updated chrome yesterday (? can't tell).

No javascript console errors are reported in firefox nor in chrome.

Not even the most basic thing works window.onresize = t; function t (e) { alert("wtf?");}.

Is it possible that I've missed some } somewhere that magically makes the code still work everywhere except in chrome and without showing any errors? What's the javascript difference between chrome and chrome incognito?

Sorry for the obscure question, but really, that's all I've got, and I've spent some time on this...

[EDIT] It was ScreenCapture's fault, a google extension: https://chrome.google.com/webstore/detail/cpngackimfmofbokmjmljamhdncknpmg

But this is a problem, I can't expect people to turn off their extensions to view my website. Why is it interfering with my code like that?

like image 398
Spectraljump Avatar asked Feb 23 '23 11:02

Spectraljump


1 Answers

Clear your cache. In Chrome for Mac, that's Chrome -> Clear Browsing Data -> Empty the Cache.

Most likely, some file in your cache is missing, outdated, or corrupted, which is why it would work in Incognito mode, but not in a normal Chrome window. Clear your cache, and if that doesn't work, make sure Chrome is updated to the latest version.

In other words, the differences between "Incognito Chrome" and "Regular Chrome" are that Incognito mode has different caches, settings, and may not use extensions by default. So if there's a problem between them, it's most likely an issue with one of those features.

Edit: Thanks Darhazer, there's a small possibility that it could also be the result of an interfering plugin. If the above doesn't work, try going to Window -> Extensions and disabling extensions to see if that might be causing the issue.

like image 132
element119 Avatar answered Feb 26 '23 10:02

element119