shihabmridha / educative.io-downloader

Free Palestine. 📖 This tool is to download course from educative.io for offline usage. It uses your login credentials and download the course.
218 stars 130 forks source link

Fix SVG image rendering issue in MHTML #30

Closed devKshitijJain closed 4 years ago

devKshitijJain commented 4 years ago

Fixes - https://github.com/shihabmridha/educative.io-downloader/issues/28

Before After
Screenshot 2020-05-06 at 4 17 47 AM Screenshot 2020-05-06 at 4 17 34 AM
the-redback commented 4 years ago

Good to see fast response. (y) I tested this PR. Works fast enough with headless: false. But, with, headless: true, it takes something around 100s to load a single page that contains SVG. It would be great help if you could do some magic regarding itthis. :D This is an example page: https://www.educative.io/courses/grokking-computer-networking/3jQgm8xAnxA

devKshitijJain commented 4 years ago

Well that's something new. Pull Bot closed it. Gonna reopen it.

devKshitijJain commented 4 years ago

@the-redback well image has to be loaded and then it need to be read using fileReader to get data uri. I am not sure how I can improve it.

devKshitijJain commented 4 years ago

Right now, you are requesting one url at a time. We should send multiple concurrent requests to boost the speed a bit up. I am gonna merge this anyway but this should be done.

Well I am not sure about it. The thing is even if we put it in array of promise. If 2nd image loads faster than first, what will happen in that case?

the-redback commented 4 years ago

@the-redback well image has to be loaded and then it need to be read using fileReader to get data uri. I am not sure how I can improve it.

Yes. And, it takes only 1/2 seconds to do all of this in headless: false. But, headless: true mode is so slow that each iterate takes 2/3 seconds, in total 100s. I wonder if it is possible to make it as faster as headless: false.

devKshitijJain commented 4 years ago

My assumption is that when headless is false in that case, the image is already visible and in memory, thus it takes very little time.