notes on fixing old photoswipe bug

Test notes on fixing old photoswipe bug

My website was no longer rendering correctly on android... I tarcked it down today to a bug in PhotoSwipe 3.0.5 that I've been using on Android since way back when.

This led me here:

But updating seemed like a pain. Lots of new features I didn't need.

So I looked into mobile debugging (again):

I added a way to fake out console.log() on mobile.

Then I added a try around the code that was erroring out and a console.log(error.stack) printout the stack.

That led to a line with this regex:

/Android (\d+.\d+)/

Which I tested on:

With this: Mozilla/5.0 (Linux; Android 10; SM-A205U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.5359.128 Mobile Safari/537.36

from here:

I changed the line to this: /Android (\d+.?\d+)/

It was not matching correctly for version 10, because version 10 has no decimal point in it.

And the bug was fixed.

This led me to creating a page, which reminds me why html sucks...

Maybe I'll use pandoc... yeah..

pandoc -o photoswipe_bug.html

But that produces busted apostrophe's with euro and TM characters showing...

But that breaks the title... so I added this to the top... hackity, hack, hack!

\<meta charset="utf-8" /> works on android again!

boom, done.