humaan / Modaal

An accessible dialog window library for all humans.
http://humaan.com/modaal/
MIT License
2.72k stars 183 forks source link

Instagram have added a URL parameter which makes modaal pop up use small thumbnail #95

Closed paulburgess closed 6 years ago

paulburgess commented 7 years ago

A URL parameter now appears in the Instagram URL used, wp=2 or wp=1, which makes the pop up image show at small thumbnail size, and appear very blurred. I tried some string replacing in the code to see if I could fix it and get that parameter out of there, but no joy.

See your own Instagram example at the bottom to see the bug in action: http://humaan.com/modaal/

Cheers!

jdm-web commented 7 years ago

I've stumbled upon the same bug and tried to investigate it. The actual api call to fetch the instagram post data, and more specifically the html embed content, seems to work. I think so because if you modify the modal script to output the processed embed in the body directly instead of the modaal container, the output is normal, with a neat image. For information the wp value in this case is wp=658 not 1 nor 2.

So there seems to be an issue with the embed processing from within the modal container. If we recap what's going on:

From my observation, if the html returned from the API is in the body directly, the process() call works properly and puts the right wp value in the iframe url. If it's inside the modaal container, the process() call does not work properly and the wp parameter has value 1.

Hope that helps. Good luck for the debug.

danhumaan commented 6 years ago

Thanks folks, started looking into the cause for this and will update further if we find a cause.

faradaytrs commented 6 years ago

any progress on this? For me wp=2 as well

danhumaan commented 6 years ago

Not at this stage @faradaytrs - time has been limited to investigate. If you (or anyone else) knows a solution or fix, you're more than welcome to open a pull request, or share your findings in here.

danhumaan commented 6 years ago

Made some updates that resolve this issue. Had to let it load at the end of the DOM wait for it to sort it's quality then clone into the modaal. Maybe not the best solution, but it's a fix for now.

Grab the latest copy for a fix.