KeepZotero
KeepZotero copied to clipboard
KeepZotero is a zotero plugin to keep zotero in taskbar by changing close to minimize
KeepZotero
KeepZotero is a zotero plugin to keep zotero in taskbar by changing close to minimize or disabling shortcut
Demo (default setting)
- Ctrl+W, close button, and Alt+F4 lead minimization

- Ctrl+Q closes Zotero

- close Zotero when it is minimization

Installation
- Download the *.xpi from Release
- Start Zotero: Tools -> Add-ons
- select "Install Add-on From File..." from the wheel on top right corner
- choose the xpi file
Usage
There are some options to decide KeepZotero's behavior
- (Default: yes) When window is not minialized, normal close way lead minialization.
This will change the normal close way - the closs button of the window, alt + F4 (Windows), close from taskbar such that they minimized the window.
When Zotero is minimized, close from taskbar terminates Zotero. - (Default: yes) Make shortcut Ctrl/Command + W to be minimization Note. this shortcut still works on pdf reader or other place out of the main panel. Clicking File/Close or File/Exit still close the Zotero.
- (Default: no) Give a confirmation dialog to avoid Exit. If it is selected, user need to confirm exit to close Zotero. (Unstable, especially MacOS) The followings only have effect on Windows or Linux:
- (Default: no) Enable the shortcut Alt + F4 to close entire Zotero. Note. Without this option, Alt + F4 minimizes Zotero.
- (Default: yes) Enable the shortcut Ctrl + Q to close entire Zotero. Note. MacOS Command + Q always closes entire Zotero.
Note. When only enable the third option, the Alt + F4 and clicking close button on titlebar will not have the confirmation dialog. However, if also enable the forth option, the Alt + F4 will give the confirmation dialog.
Different keyboard layout
If the current shortcut is not your usual shortcut (not the personal shortcut) to close the panel, please create an issue with the shortcut.
Acknowledgment
- Thanks to Thunderbird keepintaskbar. It gives me the direction.
- Thanks to Zotfile and zotero-hellow-world such that I can follow its structure and build this plugin
My Limitation and Questions
Although I have some coding experience with different language, I do not learn JavaScript or Chrome Extension(?). Thus, the code may do some stupid things... When developing this plugin, I do not find the proper documentation to explain my questions, which I write them in the code. I will appreciate if someone notice any issue inside the code or have some answer to my questions.
- I add the listener for clicking File/Close. It captures the behavior but Zotero is still closed even if I use
stopPropagation()andpreventDefault(). - I try the visiblitychange not beforeunload but Zotero seems not to change the visiblitychange property or I use the wrong window to check
- I can only use 2 not
Components.interfaces.nsIDOMChromeWindow.STATE_MINIMIZEDfor checkingwindowStateincloseListener. The later one is shown undefined. - I do not find or try the proper way such that MacOS also shows KeepZotero's preferences with buttons, so I put the sync function into unload.
- MacOS may redraw the window (Command + W close and then reopen it from taskbar). I do not regenerate the KeepZotero. KeepZotero's
openPreferenceWindowmay still use the old window not the new one such that opening preference throwsNS_ERROR_NOT_AVAILABLEerror.
Currently, I always get the current main window to avoid this question. Of course, if select the second option to make Command + W to be minimization, it somehow avoid this kind of issue.
It's proved in https://forums.zotero.org/discussion/87562/bug-i-cant-open-some-extension-for-running-zotero-a-long-time. Thus, need to get the current window to open dialog in MacOS.