y252328 / Instagram_Download_Button

Add download button to download media in the post and the story in Instagram
MIT License
230 stars 31 forks source link

Download buttons don't respond in "mobile view" with multi-image posts #31

Open embeddedjunkie opened 1 year ago

embeddedjunkie commented 1 year ago

I noticed this issue on my Android running Firefox with Tampermonkey addon. The buttons don't respond when clicked on posts that include more than 1 image. DL buttons on posts with a single image works fine. DL buttons on stories work fine. DL buttons on Reels work fine. The only way to get the buttons to respond in a multi image post is to enable "view as desktop webpage" for the post. When the page reloads as the desktop version then the buttons are responsive.

I was able to reproduce this issue on my desktop windows machine running firefox by setting the user agent as firefox mobile and by narrowing the browser window so that Instagram uses the narrow mobile UI.

y252328 commented 1 year ago

Thanks for your feedback. I will try to fix this. But the priority of this issue will be low due to this script being targeted to the desktop user.

embeddedjunkie commented 1 year ago

I think i narrowed down the bug a bit further. This is happening in multi-image/vid posts. But mediaIdx becomes undefined in a call to getUrlFromInfoApi().

I verified with a kludgefix and the download button works again on multi-image/vid posts. I tried single video/image posts and that still works.

uncaught_exception

kludgeFix

y252328 commented 1 year ago

Good finding, I have uploaded ver. 1.16.1 based on your feedback. Please update and help to check if the new version works.

embeddedjunkie commented 1 year ago

I updated and tried on a multi-image post... that works now on narrow mobile view.

However, I did notice a bug on a multi-item post that had both multiple images AND videos in a single post.

typeError