Browser.downloads.download bring FF front on macOS

Hi All,

I’m using browser.downloads.download with saveAs set to false, so the download is happening ‘silently’ in the background, it’s happening repeated and continuously on the opened webpage in the given tab, working like a charm.

I have one single issue, everytime the download starts it brings FF to the front with the effected window (the tab resides in), it’s happening even if the window was minimised and is in the macOS Dock.

How can i prevent this?

TIA!
Hofi

Are you using the call from an extension page opened in a tab? If not, how would it know what tab it belongs to?

this extension has a double layer

1.) the content.js detects the page reload (reload is forced by another extension periodically) and sends a message with the current tab doc URL to background.js

2.) the background.js handles the message and saves the given content part via
browser.downloads.download(
{
url: objectURL,
filename: targetFileName,
saveAs: false,
conflictAction: ‘overwrite’
}

So the background page no longer has any relation to the specific window the download happened in. So I wonder if it is either a side effect of a focus call in the tab of the page, or if it is not in fact related to the origin tab.

you gave me a good idea, it seems it is an issue in the page auto reloader (not in the download call part), trying to figure out the real reason
thanks!

just for the record
i was not able to manage it in FF but could fine in chrome at the and
2 issues were persistent in FF

  • each time a tab is deactivated it is stopped to trigger the onload notification (the reload progress animation could be seen in the tab, but in the console logs it could be seen that the event was not fired anymore), switching back to that tab triggers the event fine again (does not matter which auto tab reload extension i tried, it seems to me a generic FF issue)
  • the originally mentioned tab reload+ window activation issue is a also a valid one, it seems to me another FF issue

chrome has no issues like these at all, so i stayed with chrome now for this :S