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

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
dev:translator_coding [2011/04/10 17:41]
ajlyon [Saving Multiple Items]
dev:translator_coding [2011/04/20 16:52]
ajlyon adding section on cross-domain
Line 120: Line 120:
 <code javascript>​var bibtexData = Zotero.Utilities.retrieveSource(this.bibtexLink);</​code>​ <code javascript>​var bibtexData = Zotero.Utilities.retrieveSource(this.bibtexLink);</​code>​
 +== Cross-Domain Restrictions ==
 +Note that all the above functions are affected by [[https://​developer.mozilla.org/​en/​http_access_control|Firefox'​s HTTP Access Control]]. See the linked article at the Mozilla Developer Center for more details, but the gist of it is that ''​Zotero.Utilities.retrieveDocument''​ and ''​Zotero.Utilities.processDocuments''​ will not in general work when called from one domain, requesting documents from another domain. Such arrangements are actually fairly common for site index and search pages. The other functions, like ''​Zotero.Utilities.doGet'',​ will work, but the response will be a simple text string which will usually have to be processed using regular expressions,​ not XPath or other DOM-based approaches.
 +When such HTTP Access Control prevents an action, you will see an error like this in the error console or debug output:
 +<​code>​00:​41:​50 Translation using Test failed: ​
 +         ​message => Permission denied to access property '​documentElement'​
 +         ​fileName => chrome://​zotero/​content/​xpcom/​translation/​browser_firefox.js
 +         ​lineNumber => 451</​code>​
 ====== Import Translators ====== ====== Import Translators ======
 ====== Export Translators ====== ====== Export Translators ======
dev/translator_coding.txt ยท Last modified: 2017/11/12 19:53 (external edit)