I’m currently working on developing a Safari extension for FDM(Free Download Manager). When Safari wants to download, the extension takes over the default download behavior and send the download url to FDM.
I’m using Safari Web Extension to develop this extension.
I know Safari doesn’t support downloads
API, so I tried using onHeadersReceived
. If the MIME type is in the given list, the request is recognized as downloadable url, and the download should be taken over.
I use url scheme to raise FDM.
The extension now can successfully recognize downloadable url and raise FDM, but Safari still download with its own manager.
Is there a way to cancel the download for Safari after I raise FDM?
Or should I change an API, or even use other elegant methods?
I know some download manager extension can do this, such as folx
.
Please share your opinion and experience, I really appreciate.