-
Notifications
You must be signed in to change notification settings - Fork 3
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
Button enhancements #7
Comments
I'd also love if right-clicking the button had a clear downloads option. |
I believe the toggle should be fairly easy to implement. I'll do that today when I get home today. |
I haven't succeed implementing the toggle. I believe some security features are blocking what I'm trying to do. The on click callback I was trying to implement checked whether or not the current sidebar is open. Whoever the function that gives me that information returns a Promise and when I append the callback to the promise then FF tells me I'm trying to close the sidebar from a function that was not interacting with the user (and that is not allowed!) Trying to wait for the Promise makes the original callback async, and the same problem arises. I've only been successful modifying a global variable, but still it wasn't working right. It needed two clicks to work properly, one for updating the variable and another for closing it. I have a feeling some kind of nasty trick could be applied to make it work and wait for the promise, but I wouldn't want to do that. I'll keep trying, it is possible I could do something different (first time using Promises in JS!). About the right click, I still haven't found anything and I don't think WebExtensions have anything like that, I'll keep looking tho. |
@josalhor do you have a branch with your work attempting this? I haven't worked on web extensions at all but have a good understanding of JS and promises and can try to help out. |
Here you go: https://github.com/josalhor/firefox-downloads-sidebar/commit/08846b22113e986585bdd725c08eb21f712fdc1c That implementation fails telling me |
@josalhor Oof yeah, there's no easy fix for that. There are a few bugs logged about that: 1438465, 1398833. A bigger workaround would maybe be to keep track of when the sidebar is visible in storage and use that instead of But your promise code looks good! It's just an issue with Firefox that doesn't have a great workaround currently. |
Would it be possible to have a couple of enhancements to the button. Firstly that it toggles the download sidebar rather than just only open it. Secondly that the icon either has a light version for dark firefox themes or is neutral and thus changes with the toolbar text color. I'm not sure how that can be achieved but there's probably an example somewhere
The text was updated successfully, but these errors were encountered: