Addresses #327, Scrapers should either take snapshots or use URL field

Use automaticSnapshots pref (which defaults to on and is changeable in the prefs window) rather than downloadAssociatedFiles (which defaults to off and is only settable through about:config at the moment) for now in translate.js

downloadAssociatedFiles should eventually be used for PDFs and other large files, whereas automaticSnapshots will be for HTML and the like -- in the meantime, I think it's OK for scrapers to just follow the visible pref for both, since otherwise they'd be totally confused when the NIFP button took a snapshot and the scrapers didn't

Simon, if there's any problem I'm not aware of with switching this for now (other than people getting some large PDFs on JStor), let me know.
This commit is contained in:
Dan Stillman 2006-10-05 09:44:41 +00:00
parent 76b7adaa05
commit 9a96c54118

View file

@ -954,7 +954,11 @@ Zotero.Translate.prototype._generateErrorString = function(error) {
errorString += "\nurl => "+this.path
+ "\nextensions.zotero.cacheTranslatorData => "+Zotero.Prefs.get("cacheTranslatorData")
+ "\nextensions.zotero.downloadAssociatedFiles => "+Zotero.Prefs.get("downloadAssociatedFiles");
// TODO: Currently using automaticSnapshots pref for everything
// Eventually downloadAssociatedFiles may be a separate pref
// for PDFs and other large files
//+ "\nextensions.zotero.downloadAssociatedFiles => "+Zotero.Prefs.get("downloadAssociatedFiles");
+ "\nextensions.zotero.automaticSnapshots => "+Zotero.Prefs.get("automaticSnapshots");
return errorString.substr(1);
}
@ -1360,7 +1364,9 @@ Zotero.Translate.prototype._runHandler = function(type, argument) {
* does the actual web translation
*/
Zotero.Translate.prototype._web = function() {
this._downloadAssociatedFiles = Zotero.Prefs.get("downloadAssociatedFiles");
// TODO: Currently using automaticSnapshots for everything
//this._downloadAssociatedFiles = Zotero.Prefs.get("downloadAssociatedFiles");
this._downloadAssociatedFiles = Zotero.Prefs.get("automaticSnapshots");
try {
this._sandbox.doWeb(this.document, this.location);