Which download interface should we use

Add-ons for Pale Moon and other applications
General discussion, compatibility, contributed extensions, themes, plugins, and more.

Moderators: FranklinDM, Lootyhoof

thosrtanner
Lunatic
Lunatic
Posts: 395
Joined: 2014-05-10, 18:19
Location: UK

Which download interface should we use

Unread post by thosrtanner » 2017-08-20, 12:58

According to the MSN documentation, nsiDownloadManager was deprecated a while ago. Indeed when I try to se it, I'm getting some rather strange errors.

However the replacement 'Downloads.jsm' seems to also have problems. For instance, if I attempt to download a large file with Downloads.fetch(), I'll either get an error ("[Exception... "Component is not available" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame :: resource://gre/modules/DownloadCore.jsm :: this.DownloadError :: line 1498" data: no]") or the returned promise will never succeed (despite the download manager screen saying the download has completed), and leaving me with a lot of truncated (usually zero length) files. If the file is small enough, it appears to succeed normally (eventually)

JustOff

Re: Which download interface should we use

Unread post by JustOff » 2017-08-20, 13:10

I think the only way to find the answer is to dig into the browser's sources and look how this is currently done there.

thosrtanner
Lunatic
Lunatic
Posts: 395
Joined: 2014-05-10, 18:19
Location: UK

Re: Which download interface should we use

Unread post by thosrtanner » 2017-08-20, 13:40

urg. Well judging by there being something in the tests called this:

Code: Select all

function oldDownloadManagerDisabled()
{
  try {
    // This method throws an exception if the old Download Manager is disabled.
    Services.downloads.activeDownloadCount;
  } catch (ex) {
    return true;
  }
  return false;
}
and when I run similar, I get 'true', I'd guess nsiDownloadManager is dead (and in that case probably a lot of stuff can be removed)

In which case the new one doesn't behave awfully well on very large files.

thosrtanner
Lunatic
Lunatic
Posts: 395
Joined: 2014-05-10, 18:19
Location: UK

Re: Which download interface should we use

Unread post by thosrtanner » 2017-08-20, 14:44

But this file always fails:

http://www.podtrac.com/pts/redirect.mp3 ... it0618.mp3

though I can drop that link into the browser and get the expected mp3 playing

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35475
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Which download interface should we use

Unread post by Moonchild » 2017-08-20, 16:50

nsIDownloadManager has been disabled because there were issues hooking the front-end up to the platform code. JS downloads is the only download interface available at the moment.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

thosrtanner
Lunatic
Lunatic
Posts: 395
Joined: 2014-05-10, 18:19
Location: UK

Re: Which download interface should we use

Unread post by thosrtanner » 2017-08-20, 18:46

Thanks - converting to the new one then

Locked