Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dev:zotero_7_for_developers [2024/12/14 03:09] – [Custom Reader Event Handlers] dstillmandev:zotero_7_for_developers [2025/02/02 06:38] (current) – [XUL Overlays → bootstrap.js] dstillman
Line 13: Line 13:
 <html><span style="color: red; font-weight: bold">WARNING:</span></html> These are test builds based on Firefox 128 intended solely for use by Zotero plugin developers and **should not be used in production**. We strongly recommend using a [[https://www.zotero.org/support/kb/multiple_profiles|separate profile and data directory]] for development. <html><span style="color: red; font-weight: bold">WARNING:</span></html> These are test builds based on Firefox 128 intended solely for use by Zotero plugin developers and **should not be used in production**. We strongly recommend using a [[https://www.zotero.org/support/kb/multiple_profiles|separate profile and data directory]] for development.
  
-<HTML><!--The ''dev'' channel has been paused. Use [[:beta_builds|Zotero 7 beta builds]] for development.--></HTML>+The ''dev'' channel has been paused. Use [[:beta_builds|Zotero 7 beta builds]] for development.
  
 +<HTML><!--
   * [[https://www.zotero.org/download/client/dl?channel=dev&platform=mac|Mac]]   * [[https://www.zotero.org/download/client/dl?channel=dev&platform=mac|Mac]]
   * [[https://www.zotero.org/download/client/dl?channel=dev&platform=linux-x86_64|Linux 64-bit]]   * [[https://www.zotero.org/download/client/dl?channel=dev&platform=linux-x86_64|Linux 64-bit]]
Line 22: Line 23:
   * [[https://www.zotero.org/download/client/dl?channel=dev&platform=win-arm64|Windows ARM64 Installer]]   * [[https://www.zotero.org/download/client/dl?channel=dev&platform=win-arm64|Windows ARM64 Installer]]
   * [[https://www.zotero.org/download/client/dl?channel=dev&platform=win32-zip|Windows 32-bit ZIP]]   * [[https://www.zotero.org/download/client/dl?channel=dev&platform=win32-zip|Windows 32-bit ZIP]]
-  * [[https://www.zotero.org/download/client/dl?channel=dev&platform=win32|Windows 32-bit Installer]]+  * [[https://www.zotero.org/download/client/dl?channel=dev&platform=win32|Windows 32-bit Installer]]--></HTML>
 ===== Sample Plugin ===== ===== Sample Plugin =====
  
Line 33: Line 34:
 Since Zotero is based on Firefox, it's possible to use the Firefox Developer Tools to interact with the DOM, set code breakpoints, follow network requests, and more. Since Zotero is based on Firefox, it's possible to use the Firefox Developer Tools to interact with the DOM, set code breakpoints, follow network requests, and more.
  
-Zotero 7 beta builds include the Firefox 115 devtools. To start a beta build with the Browser Toolbox open, pass the ''-jsdebugger'' flag on the command line:+Zotero 7 beta builds include the Firefox 128 devtools. To start a beta build with the Browser Toolbox open, pass the ''-jsdebugger'' flag on the command line:
  
 <code> <code>
Line 212: Line 213:
 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. 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.
  
-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. 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''. (''Zotero'' also isn't available in ''uninstall()'' in Zotero 6.) The sample plugin provides an example of [[https://github.com/zotero/make-it-red/blob/main/src-1.2/bootstrap.js|waiting for availability of the ''Zotero'' object]] and [[https://github.com/zotero/make-it-red/blob/main/src-1.2/lib.js|importing global properties]] in a bootstrapped plugin that works in both Zotero 6 and 7.+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. 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''. (''Zotero'' also isn't available in ''uninstall()'' in Zotero 6.) The sample plugin provides an example of [[https://github.com/zotero/make-it-red/blob/main/src-1.2/bootstrap.js|waiting for availability of the ''Zotero'' object]] and [[https://github.com/zotero/make-it-red/blob/main/src-1.2/make-it-red.js|importing global properties]] in a bootstrapped plugin that works in both Zotero 6 and 7.
  
 Bootstrapped plugins can be disabled or uninstalled without restarting Zotero, so you'll need to make sure you remove all functionality in the ''shutdown()'' function. Bootstrapped plugins can be disabled or uninstalled without restarting Zotero, so you'll need to make sure you remove all functionality in the ''shutdown()'' function.
Line 503: Line 504:
 ==== Custom Item Tree Columns ==== ==== Custom Item Tree Columns ====
  
-Zotero 7 beta 23 adds an API for creating custom columns in the item tree. The item tree is widely used in Zotero for displaying a table of items (e.g., the items list in the main library view and the search results in the Advanced Search window).+Zotero 7 adds an API for creating custom columns in the item tree. The item tree is widely used in Zotero for displaying a table of items (e.g., the items list in the main library view and the search results in the Advanced Search window).
  
 If you were previously using monkey-patching to add custom columns in Zotero 6, please switch to using the official API in Zotero 7. If you were previously using monkey-patching to add custom columns in Zotero 6, please switch to using the official API in Zotero 7.
Line 674: Line 675:
 The following list includes nearly all Mozilla changes that affected Zotero code. You may encounter other breaking changes if you use APIs not used in Zotero. [[https://searchfox.org/|Searchfox]] is the best resource for identifying current correct usage in Mozilla code and changes between Firefox 60 and Firefox 128. The following list includes nearly all Mozilla changes that affected Zotero code. You may encounter other breaking changes if you use APIs not used in Zotero. [[https://searchfox.org/|Searchfox]] is the best resource for identifying current correct usage in Mozilla code and changes between Firefox 60 and Firefox 128.
  
-Earlier Zotero 7 beta releases were based on Firefox 102, so we've listed changes for Firefox 102 and Firefox 115 separately. An upcoming beta will be based on Firefox 128.+Earlier Zotero 7 beta releases were based on Firefox 102, so we've listed changes for Firefox 102115, and 128 separately.
  
 === Firefox 60 → Firefox 102 === === Firefox 60 → Firefox 102 ===
dev/zotero_7_for_developers.1734163752.txt.gz · Last modified: 2024/12/14 03:09 by dstillman