Add context menuitem to popup menu in Downloads button

I want help to add a menuitem in there popup_image . Under the “Remove from History Entry”. My addon is based on xul. My addon is the Deletebutton.

This easy, can you share your code, is it on github?

Thanks for the reply here is the link with the full source code

will look into code later when im free as i have to dig for relavent code on how you do things.

but this is what i attach a menu pop:

http://mdn.beonex.com/en/XUL_Tutorial/Popup_Menus

I have tried this before but I can’t make it play. Because I use XUL overlay and the popup menu is dynamic. When you don’t have downloads this popup menu doesn’t exist so the overlay cannot work. I should use some javascript but I don’t know how. Also had I tried to do it using XUL when the “down arrow” was pressed after a download it didn’t open the download popup. I hope you understand what I am saying.
Thanks.

I haven’t looked at all the code in detail, but maybe you want to overlay “contentAreaDownloadsView.xul” instead of “allDownloadsViewOverlay.xul”

Also, you shouldn’t use ctypes for deleting a file, please use nsiFile.remove()

I prefer OS.File over nsIFile :slight_smile: https://developer.mozilla.org/en-US/docs/JavaScript_OS.File/OS.File_for_the_main_thread

Right, I was looking for that, but couldn’t find it :smile:
MDN search is tricky sometimes.

Thank you @noitidart!

1 Like

I have tried the contentAreaDownloadsView.xul and it doesn’t work. As for the nsFile.remove I use it when not in Windows platform. When I am in Windows platform I use the Windows API in order to send the file to the Recycle bin. If you use the nsiFile.remove the file is deleted permantly.