Don't attempt to run regular expressions on very long URIs (fixes incompatibility with Update Scanner as reported at http://forums.zotero.org/discussion/17604/216-translator-hangs-with-addon-update-scanner/#Item_0)
This commit is contained in:
parent
a6727940f4
commit
0a3b96bd9c
1 changed files with 2 additions and 1 deletions
|
@ -991,8 +991,9 @@ Zotero.Translate.Web.prototype._getPotentialTranslators = function() {
|
||||||
var allTranslators = Zotero.Translators.getAllForType("web");
|
var allTranslators = Zotero.Translators.getAllForType("web");
|
||||||
var potentialTranslators = [];
|
var potentialTranslators = [];
|
||||||
|
|
||||||
|
Zotero.debug("Translate: Running regular expressions");
|
||||||
for(var i=0; i<allTranslators.length; i++) {
|
for(var i=0; i<allTranslators.length; i++) {
|
||||||
if(!allTranslators[i].webRegexp || allTranslators[i].webRegexp.test(this.location)) {
|
if(!allTranslators[i].webRegexp || (this.location.length < 8192 && allTranslators[i].webRegexp.test(this.location))) {
|
||||||
potentialTranslators.push(allTranslators[i]);
|
potentialTranslators.push(allTranslators[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue