-
Notifications
You must be signed in to change notification settings - Fork 517
Description
Actual Behavior
I wrote a script trying to download an mp4 file using GM_download. However, it fails in Safari with different behaviors depending on the Download Mode setting:
-
Mode: Browser API
- It immediately fails with
onerror. - Error:
not_succeeded. - There is no
detailfield, only anid. - Network Analysis: The request initiator is
Tampermonkey Extension. It does not send Cookies, causing the download to fail (likely due to server authentication requirements).
- It immediately fails with
-
Mode: Native
- The download behaves "normally" regarding the network request.
- After the download finishes, the
onloadcallback is triggered. - Issue: The file is not saved to my Downloads folder.
-
Mode: Default
- The download behaves "normally" regarding the network request.
- After the download finishes, the
onerrorcallback is triggered. - Error:
Out of memory. - There is no
detailfield, only anid.
Network Analysis for Native/Default in Safari:
The request initiator is WebKit Networking. These requests do carry Cookies, so the download happens successfully (triggering onprogress), but they fail to save the resulting mp4 file correctly.
Use case note: Previously, the "Browser API" mode worked fine. I suspect the backend recently changed to enforce Cookies, though I cannot prove this.
Comparison with Chrome (Arc Browser):
- Mode: Default: Works perfectly. Request initiator is
Browser Helper(with Cookies). - Mode: Native: Works perfectly. First, a "Save As" dialog appears, then it downloads.
onprogressworks, initiator isBrowser Helper(with Cookies). - Mode: Browser API: Behavior is inconsistent/weird:
- 1st Attempt:
onprogressis NOT called. Initiator isBrowser Helper(with Cookies). After download, a specific save dialog appears. - Refresh & 2nd Attempt: A save dialog appears first, then downloading starts.
onprogressis called normally. Initiator isBrowser Helper(with Cookies). Download works.
- 1st Attempt:
Expected Behavior
GM_download should consistently download the file and save it to the disk across all modes in Safari, ensuring Cookies are included in the request if the script context allows it, just as it does in Chrome. Specifically:
- "Browser API" mode in Safari should include Cookies.
- "Native" mode in Safari should save the file to the disk upon completion.
- "Default" mode should not throw an "Out of memory" error.
Steps to reproduce the issue
- Create a script using
GM_downloadto download a large file (e.g., mp4) from a server that requires Cookies/Authentication. - Open Safari.
- Go to Tampermonkey Settings -> General -> Downloads BETA -> Download Mode.
- Test with 'Browser API', 'Native', and 'Default'.
- Observe the errors described above (No Cookie/Not Succeeded, File not saved, or Out of Memory).
Screenshots or Screencasts
N/A
Environment (please complete the following information)
- Browser and Version:
- Safari: Version 26.1 (20622.2.11.119.1)
- Arc (Chrome): Chromium Engine Version 139.0.7258.128
- Tampermonkey version:
- Safari: Version 5.4.6229(6229)
- Arc: 5.4.0
- Operating System and Version: macOS 15.7.2 (24G325)
Script
See here.