Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downloading is not working on Firefox. #64

Open
UnCrevard opened this issue Jan 27, 2024 · 4 comments
Open

Downloading is not working on Firefox. #64

UnCrevard opened this issue Jan 27, 2024 · 4 comments

Comments

@UnCrevard
Copy link

The fetch method to download file is not working for Firefox (cors problem most of the time).

A better way is to use the tampermonkey downloader. Simply add @grant GM_download to script headers then change the function downloadResource by GM_download(url,filename+".mp4")

GM_download is done with webext. So no cross-origin problem.

I have to fix the script at every update 😅

@UnCrevard UnCrevard changed the title Downloading is now working on Firefox. Downloading is not working on Firefox. Jan 27, 2024
@dinners5
Copy link

dinners5 commented Feb 2, 2024

Thanks!

Add an if statment to sort between jpg and mp4..

if (url.contains("mp4")) {
GM_download(url, filename+".mp4");
} else {
GM_download(url, filename+".jpg");
}

@DohnJoe2
Copy link

I managed to get it working in Firefox by commenting out the 732nd line in code.
Before: 'User-Agent': window.navigator.userAgent
After: // 'User-Agent': window.navigator.userAgent

pghadq716010i2ji8x3z9g9b4ot7

@grant
Copy link

grant commented Feb 13, 2024

Don't add me.

@Patty-OFurniture
Copy link
Contributor

Confirmed. With CORS mode, at least Firefox seems to be like this. "User-agent header is only permitted for CORS when the server has opted in with "Access-Control-Allow-Headers: user-agent""

Haven't checked Chrome, but I would assume it's similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants