Adaptive-Images
Adaptive-Images copied to clipboard
Improved JavaScript for cookie-dealing with high-ppi devices.
As I reported in https://github.com/MattWilcox/Adaptive-Images/issues/115, I see a problem in using screen.width alone as a source for doing the math, when it comes to high-ppi devices.
It seems I now figured out a highly reliabe way to detect the actual screen size of a display – meaning especially the high-ppi screens on mobiles like smartphones and tablets.
Have a look: https://github.com/Darkwing371/Adaptive-Images-Uber-Extended/tree/ai-cookie-snippet.js
Read the readme, check code and comments and feel free to comment/contribute for improvements and suggestions!
And most of all: use it, if you think it’s a good idea! :)
Note: since this is my first pull request ever, I hope everything went ok with it so far … ;)