tejacques / crosstab

A utility library for cross-tab communication using localStorage.
Apache License 2.0
364 stars 58 forks source link

addEventListener not available #48

Closed nibzo1 closed 8 years ago

nibzo1 commented 8 years ago

ie8 does not support window.addEventListener, detect and use ie8 event handler window.attachEvent

tejacques commented 8 years ago

Hi @nibzo1,

Thanks for your interest in this project!

I appreciate the idea and the effort, but the issue with IE8 is actually much more complicated than just attaching by calling attachEvent.

IE8 does not have proper StorageEvents in that they do not contain the data about what changed. This is why I created IE8-EventListener as a polyfill for IE8 which exposes an alternate localStorage which does provide this information. This library uses that one for its IE8 tests, which is why they pass.

I have not listed crosstab as supported/working on IE8 with the use of that library however because there are some major performance issues with how the polyfill works. Using it would work but would likely ruin the user's experience of the site they are viewing. Until those have been addressed IE8 will not be officially supported.

If you would like to help us get there, contributing to IE8-EventListener to improve performance is the way to go.

Thanks!

nibzo1 commented 8 years ago

Thanks for the reply,

I had read this in the documentation although forgot that IE8 was not fully supported. This is not an issue for me, I had been testing on various browsers and realised IE8 had some different names for event handlers. All appeared to work for me once I corrected switched to use the different handler names.

"Using it would work but would likely ruin the user's experience of the site they are viewing" I guess this goes for anyone using IEx on the web :-)

I really like your project and will follow the development, thanks