-
Notifications
You must be signed in to change notification settings - Fork 8
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
Tell the observer if the download is coming from a private tab #97
Tell the observer if the download is coming from a private tab #97
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not quite there yet but close. I think idea to deliver private status to the user interface is good and should be implemented. Provided some guidelines and instructions how this should be improved.
jscomps/EmbedliteDownloadManager.js
Outdated
@@ -89,6 +91,7 @@ let DownloadView = { | |||
JSON.stringify({ | |||
msg: "dl-fail", | |||
id: download.id, | |||
privateMode: PrivateBrowsingUtils.isContentWindowPrivate(Services.ww.activeWindow) || false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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 download.source.isPrivate
for each "embed:download" notifies of the onDownloadChanged (and onDownloadAdded). Simpler just to have it foreach "embed:download" message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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!
Any comments? |
I would like to implement your changes, but had no time to work on it. Maybe next week 🤞 |
Thanks, it's almost there. Easier to explain in form of PR this #98 so I created one. Point is that we need to pass privateMode update from each download message that we send from the embedlite-components to browser app. |
Follow up of sailfish-browser!1057 to propagate the private mode information.