-
Notifications
You must be signed in to change notification settings - Fork 8
Tell the observer if the download is coming from a private tab #97
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,7 @@ const Cu = Components.utils; | |
| const Cr = Components.results; | ||
|
|
||
| const { XPCOMUtils } = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); | ||
| const { PrivateBrowsingUtils } = ChromeUtils.import("resource://gre/modules/PrivateBrowsingUtils.jsm"); | ||
|
|
||
| XPCOMUtils.defineLazyModuleGetter(this, "Downloads", | ||
| "resource://gre/modules/Downloads.jsm"); | ||
|
|
@@ -78,6 +79,7 @@ let DownloadView = { | |
| JSON.stringify({ | ||
| msg: "dl-done", | ||
| id: download.id, | ||
| privateMode: PrivateBrowsingUtils.isContentWindowPrivate(Services.ww.activeWindow) || false, | ||
|
ilpianista marked this conversation as resolved.
Outdated
|
||
| saveAsPdf: download.saveAsPdf || false, | ||
| targetPath: download.target.path | ||
| })); | ||
|
|
@@ -89,6 +91,7 @@ let DownloadView = { | |
| JSON.stringify({ | ||
| msg: "dl-fail", | ||
| id: download.id, | ||
| privateMode: PrivateBrowsingUtils.isContentWindowPrivate(Services.ww.activeWindow) || false, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When downloading normally without pausing / cancelling and continuing download these "embed:download" notifies inside onDownloadAdded should not trigger. In normal scenario onDownloadAdded gets called only once per download (first thing that happens). To report status changes you need to stringify
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure I understood this, please have a look to my changes. Thanks! |
||
| saveAsPdf: download.saveAsPdf || false | ||
| })); | ||
| } | ||
|
|
@@ -98,6 +101,7 @@ let DownloadView = { | |
| JSON.stringify({ | ||
| msg: "dl-cancel", | ||
| id: download.id, | ||
| privateMode: PrivateBrowsingUtils.isContentWindowPrivate(Services.ww.activeWindow) || false, | ||
| saveAsPdf: download.saveAsPdf || false | ||
| })); | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.