Skip to content

Commit

Permalink
Make API server configurable with extensions.zotero.api.url
Browse files Browse the repository at this point in the history
Needless to say, use of this pref is unsupported.

Closes zotero#901
  • Loading branch information
dstillman committed Dec 21, 2016
1 parent 205bab7 commit 084f5a7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion chrome/content/zotero/xpcom/sync/syncRunner.js
Expand Up @@ -41,7 +41,15 @@ Zotero.Sync.Runner_Module = function (options = {}) {
Zotero.defineProperty(this, 'syncInProgress', { get: () => _syncInProgress });
Zotero.defineProperty(this, 'lastSyncStatus', { get: () => _lastSyncStatus });

this.baseURL = options.baseURL || ZOTERO_CONFIG.API_URL;
Zotero.defineProperty(this, 'baseURL', {
get: () => {
let url = options.baseURL || Zotero.Prefs.get("api.url") || ZOTERO_CONFIG.API_URL;
if (!url.endsWith('/')) {
url += '/';
}
return url;
}
});
this.apiVersion = options.apiVersion || ZOTERO_CONFIG.API_VERSION;

// Allows tests to set apiKey in options or as property, overriding login manager
Expand Down

0 comments on commit 084f5a7

Please sign in to comment.