You must then remove all references to a window or objects within it, cancel any timers, etc., when onMainWindowUnload is called, or else you'll risk creating a memory leak every time the window is closed. On some platforms, the main window can be opened and closed multiple times during a Zotero session, so any window-related activities, such as modifying the main UI, adding menus, or binding shortcuts must be performed by onMainWindowLoad so that new main windows contain your changes. ( Zotero also isn't available in uninstall() in Zotero 6.) The sample plugin provides an example of waiting for availability of the ''Zotero'' object and importing global properties in a bootstrapped plugin that works in both Zotero 6 and 7.īootstrapped plugins can be disabled or uninstalled without restarting Zotero, so you'll need to make sure you remove all functionality in the shutdown() function.Īn object with a window property containing the target window This isn't the case in Zotero 6, in which these functions can load before the Zotero object is available and won't automatically get window properties such as URL. In Zotero 7, the install() and startup() bootstrap methods are called only after Zotero has initialized, and the Zotero object is automatically made available in the bootstrap scope, along with Services, Cc, Ci, and other Mozilla and browser objects. Note that Zotero 6 provides a resourceURI nsIURI object instead of a rootURI string, so for Zotero 6 compatibility you'll want to assign resourceURI.spec to rootURI if rootURI isn't provided. "update_hash": "sha256:9b0546d5cf304adcabf39dd13c9399e2702ace8d76882b0b37379ef283c7db13",Ī number representing the reason for the event, which can be checked against the following constants: APP_STARTUP, APP_SHUTDOWN, ADDON_ENABLE, ADDON_DISABLE, ADDON_INSTALL, ADDON_UNINSTALL, ADDON_UPGRADE, ADDON_DOWNGRADEĪny initialization unrelated to specific windows should be triggered by startup, and removal should be triggered by shutdown. In this example, version 1.2 is compatible with both Zotero 6 and 7, and version 2.0 is compatible only with Zotero 7: Since Zotero 6 is based on Firefox 60.9.0 ESR, you can use 60.9 for strict_min_version and strict_max_version. Zotero 6 also supports this manifest format with a slight variation: you must specify minimum and maximum versions using applications.gecko instead of applications.zotero, and you must use the Firefox platform version instead of the Zotero app version. The legacy RDF update manifest for specifying updates must be replaced with a Mozilla-style JSON update manifest: Use "strict_min_version": "6.999" to allow your plugin to be installed on Zotero 7 betas. (You can later update compatibility via your update manifest without distributing a new version if no changes are required.) ![]() You should set strict_max_version to x.x.* of the latest minor version that you have tested your plugin with. Most WebExtension manifest.json keys are not relevant in Zotero, but you should transfer the main metadata from install.rdf.Īpplications.zotero is based on browser_specific_settings.gecko and must be present for Zotero to install your plugin. ![]() The legacy install.rdf manifest must be replaced with a WebExtension-style manifest.json file.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |