twitter-video-downloader-extension icon indicating copy to clipboard operation
twitter-video-downloader-extension copied to clipboard

feat: Add direct download mode

Open wa-candra opened this issue 2 years ago • 1 comments

Hi @mstfsnc , first of all, thanks for making this extension, and I admire your decision to make this open source. This extension helps me a lot with my tasks.

So, let's get to the main point. This PR is adding option for user to able to choose whether they want to download by javascript (default, current implementation) or through direct download (we provide link, and user right click -> save link as)

The Reason

The reason I create this pull request is, I never big fan of downloading file through javascript (fetch blob), because in my experience with this extension, it is a bit unreliable. When it comes to download video with duration longer than 1 min, it will most likely silently error and got stuck in loading phase. I don't know why though.

Feature Overview

So, I add optional feature to switch download mode to direct download, which is we only provide link, and ask user to do right-click and choose 'Save link as..' option. Screenshot_2022-11-02_13-04-49

Of course, this is an optional feature, I still maintain the javascript download mode as default. But I add fallback strategy in case of any error happened. Screenshot_2022-11-02_13-03-58 The 'X' icon and link button above will appear if download by javascript failed.

I also add option page, to choose between javascript mode or direct donwload mode. Screenshot_2022-11-02_13-11-42

I also add storage permission to save user settings. Accessing user settings data is a little bit tricky because injected scripts (content.js) didn't have access to chrome APIs, so I inject the user settings data from extension storage to browser localStorage on page load, implemention details can be seen in src/inject.js

I guess that's it for now. I'm looking forward to hear your feedback.

wa-candra avatar Nov 02 '22 06:11 wa-candra

Hi @wa-candra,

Sorry for my late reply. I'm so excited for your contribution. I will review and reply as soon as possible.

mstfsnc avatar Dec 22 '22 21:12 mstfsnc