diff --git a/chrome/content/zotero/xpcom/connector/repo.js b/chrome/content/zotero/xpcom/connector/repo.js index 709971d36..d74d89f67 100644 --- a/chrome/content/zotero/xpcom/connector/repo.js +++ b/chrome/content/zotero/xpcom/connector/repo.js @@ -66,10 +66,12 @@ Zotero.Repo = new function() { } // then try repo - Zotero.HTTP.doGet(ZOTERO_CONFIG.REPOSITORY_URL+"/code/"+ZOTERO_CONFIG.REPOSITORY_CHANNEL+"/"+translatorID, function(xmlhttp) { - _haveCode(xmlhttp.status === 200 ? xmlhttp.responseText : false, translatorID, - Zotero.Repo.SOURCE_REPO, callback); - }); + Zotero.HTTP.doGet(ZOTERO_CONFIG.REPOSITORY_URL+"/code/"+translatorID+"?version="+Zotero.version, + function(xmlhttp) { + _haveCode(xmlhttp.status === 200 ? xmlhttp.responseText : false, translatorID, + Zotero.Repo.SOURCE_REPO, callback); + } + ); }); }; @@ -135,7 +137,7 @@ Zotero.Repo = new function() { * Retrieve metadata from repository */ function _updateFromRepo(reset, callback) { - var url = ZOTERO_CONFIG.REPOSITORY_URL+"/metadata?last="+ + var url = ZOTERO_CONFIG.REPOSITORY_URL+"/metadata?version="+Zotero.version+"&last="+ (reset ? "0" : Zotero.Prefs.get("connector.repo.lastCheck.repoTime")); Zotero.HTTP.doGet(url, function(xmlhttp) { diff --git a/chrome/content/zotero/xpcom/connector/translator.js b/chrome/content/zotero/xpcom/connector/translator.js index caf4a31bb..3418f90e2 100644 --- a/chrome/content/zotero/xpcom/connector/translator.js +++ b/chrome/content/zotero/xpcom/connector/translator.js @@ -243,7 +243,9 @@ Zotero.Translators = new function() { if(!newMetadata.length) return; if(reset) { - var serializedTranslators = newMetadata; + var serializedTranslators = newMetadata.filter(function(translator) { + return !translator.deleted; + }); } else { var serializedTranslators = []; var hasChanged = false; @@ -252,7 +254,10 @@ Zotero.Translators = new function() { for(var i in newMetadata) { var newTranslator = newMetadata[i]; - if(_translators.hasOwnProperty(newTranslator.translatorID)) { + if(newTranslator.deleted) { + // handle translator deletions + delete _translators[newTranslator.translatorID]; + } else if(_translators.hasOwnProperty(newTranslator.translatorID)) { var oldTranslator = _translators[newTranslator.translatorID]; // check whether translator has changed @@ -395,7 +400,7 @@ Zotero.Translator.prototype.init = function(info) { for(var i in TRANSLATOR_REQUIRED_PROPERTIES) { var property = TRANSLATOR_REQUIRED_PROPERTIES[i]; if(info[property] === undefined) { - this.logError('Missing property "'+property+'" in translator metadata JSON object in ' + info.label); + Zotero.logError(new Error('Missing property "'+property+'" in translator metadata JSON object in ' + info.label)); haveMetadata = false; break; } else { diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index 820a5fe23..2f4cbbd02 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -29,7 +29,6 @@ const ZOTERO_CONFIG = { REPOSITORY_URL: 'https://repo.zotero.org/repo', REPOSITORY_CHECK_INTERVAL: 86400, // 24 hours REPOSITORY_RETRY_INTERVAL: 3600, // 1 hour - REPOSITORY_CHANNEL: 'trunk', BASE_URI: 'http://zotero.org/', WWW_BASE_URL: 'http://www.zotero.org/', SYNC_URL: 'https://sync.zotero.org/', @@ -2275,10 +2274,13 @@ Zotero.Browser = new function() { hiddenBrowser.setAttribute('disablehistory', 'true'); win.document.documentElement.appendChild(hiddenBrowser); // Disable some features + hiddenBrowser.docShell.allowAuth = false; + hiddenBrowser.docShell.allowDNSPrefetch = false; hiddenBrowser.docShell.allowImages = false; hiddenBrowser.docShell.allowJavascript = false; hiddenBrowser.docShell.allowMetaRedirects = false; hiddenBrowser.docShell.allowPlugins = false; + hiddenBrowser.docShell.canExecuteScripts = false; Zotero.debug("created hidden browser (" + (win.document.getElementsByTagName('browser').length - 1) + ")"); return hiddenBrowser;