universal-parallax icon indicating copy to clipboard operation
universal-parallax copied to clipboard

Library is breaking safari-features (e.g. web-push)

Open HailToDodongo opened this issue 3 years ago • 3 comments

In this line the variable safari is set, which will also override window.safari : https://github.com/marrio-h/universal-parallax/blob/257276d064c2150958af696c47c27286a593e6d3/dist/universal-parallax.js#L13 However, this is already set by safari itself and contains important objects like window.safari.pushNotification. This prevents/breaks web-push functionality on safari. These checks should be scoped locally anyways to prevent polluting the global namespace.

HailToDodongo avatar Sep 08 '20 12:09 HailToDodongo

I opened the test/demo files on my Mac, and on Mac every browser I have fully worked, except Safari won't show any images, it did show the shaded containers with the info and that was it.... The Safari code line in all .JS files needs to be updated.

bluewolf2072 avatar Oct 06 '20 18:10 bluewolf2072

UPDATE! For me this issue has been resolved... I decided to do further testing, so I uploaded the demo and dist files to a test folder on one of my websites. Guess what loaded in Safari? - yeah the demo index file. I even tested the link on an iOS device and it loaded. The Parallax effect was fully functional. With my test I even created a video at the top and that was fully working for the most part, though I have to redo the code for the video to make sure it takes full screen even for mobile and to remove padding below it.

With Safari on Mac OS, if you do not have the Developer option turned on you will not see the demo live or function.. With my test the server version was fully functional before turning the Developer mode on, once it was activated then the local demo files were also working. On my Mac I opened the local files with VS Code and then used LiveServer to view the content in Safari to see if the issue was still there and it was not; this prompted me to do an actually test from a live website and it worked..

bluewolf2072 avatar Oct 06 '20 21:10 bluewolf2072

This issue is not about the functionality of the library, it's working fine as it is. It's about the fact that it's breaking other functions that the browser provides (like webpush). Which can be prevented by not polluting the safari property.

HailToDodongo avatar Oct 11 '20 19:10 HailToDodongo