Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
dev:client_coding:connector_http_server [2017/11/12 19:53]
127.0.0.1 external edit
dev:client_coding:connector_http_server [2019/06/19 19:49] (current)
bwiernik
Line 1: Line 1:
-<​html><​p id="​zotero-5-update-warning"​ style="​color:​ red; font-weight:​ bold">​We’re +====== Zotero ​Connector HTTP Server ======
-in the process of updating the documentation for +
-<a href="​https://​www.zotero.org/​blog/​zotero-5-0">​Zotero ​5.0</​a>​. Some documentation +
-may be outdated in the meantime. Thanks for your understanding.</​p></​html>​+
  
- +Zotero has a built-in HTTP server to communicate with the [[/support/​standalone#​zotero_connectors|Zotero Connector]] browser extensions.
-Zotero has a built-in HTTP server ​designed ​to communicate with the Safari and Chrome extensions, called Connector. This HTTP server is enabled by default in Zotero Standalone and it can be enabled for Zotero in Firefox by setting ''​extensions.zotero.httpServer.enabled''​ to ''​true''​ in about:​config. See the [[kb/httpserver enabled|knowledge base article]].+
  
 The connector server defines several endpoints by default, including: The connector server defines several endpoints by default, including:
Line 15: Line 11:
   * ''/​connector/​ping''​   * ''/​connector/​ping''​
  
-These endpoints are implemented in [[https://​github.com/​zotero/​zotero/​blob/​master/​chrome/​content/​zotero/​xpcom/​server_connector.js|server_connector.js]]. The server is implemented in [[https://​github.com/​zotero/​zotero/​blob/​master/​chrome/​content/​zotero/​xpcom/​server.js|server.js]].+These endpoints are implemented in [[https://​github.com/​zotero/​zotero/​blob/​master/​chrome/​content/​zotero/​xpcom/connector/​server_connector.js|server_connector.js]]. The server is implemented in [[https://​github.com/​zotero/​zotero/​blob/​master/​chrome/​content/​zotero/​xpcom/​server.js|server.js]].
  
 ====== Extending the Connector Server ====== ====== Extending the Connector Server ======
-The following code registers an additional endpoint with the built-in ​connector ​HTTP server.+The following code registers an additional endpoint with the connector server.
  
-This script must be run with chrome privileges. The best way to do this is to create an extension that [[https://​developer.mozilla.org/​en/​XPCOM/​Receiving_startup_notifications|registers an XPCOM service to run at Firefox ​startup]]. ​Firefox 4 users also have the option of creating ​a [[https://​developer.mozilla.org/​en/​Extensions/​Bootstrapped_extensions|bootstrapped extension]]. Alternatively,​ you could register the endpoint from a overlay or from a chrome URI that you load manually.+This script must be run with chrome privileges. The best way to do this is to create an extension that [[https://​web.archive.org/​web/​20190612191336/​https://​developer.mozilla.org/​en-US/​docs/​Mozilla/​Tech/XPCOM/Guide/​Receiving_startup_notifications|registers an XPCOM service to run at Zotero ​startup]]. ​This can (and should if possible) be a [[https://​web.archive.org/​web/​20190613013728/​https://​developer.mozilla.org/​en-US/​docs/​Archive/Add-ons/​Bootstrapped_extensions|bootstrapped extension]]. Alternatively,​ you could register the endpoint from a overlay or from a chrome URI that you load manually.
  
 Once registered, going to http://​127.0.0.1:​23119/​myAddon/​helloWorld in a web browser should produce a page containing "Hello world."​ Once registered, going to http://​127.0.0.1:​23119/​myAddon/​helloWorld in a web browser should produce a page containing "Hello world."​
dev/client_coding/connector_http_server.1510534412.txt.gz · Last modified: 2019/06/19 19:44 (external edit)