Add prefs for timeouts for downloading PDF via browser

1 second isn't enough for some users, so try 1.5, and allow for easier
debugging via a pref.

https://forums.zotero.org/discussion/96431/i-have-access-to-pdf-but-zotero-cannot-automatically-add-it
https://forums.zotero.org/discussion/97277/unable-to-download-papers-using-zotero-chrome-extension
This commit is contained in:
Dan Stillman 2022-05-20 04:59:30 -04:00
parent cb2594f53f
commit 5eecc3fc54
2 changed files with 5 additions and 2 deletions

View file

@ -1137,9 +1137,9 @@ Zotero.Attachments = new function(){
*/
this.downloadPDFViaBrowser = async function (url, path, options = {}) {
Zotero.debug(`downloadPDFViaBrowser: Downloading file via browser from ${url}`);
const onLoadTimeout = 1e3;
const onLoadTimeout = Zotero.Prefs.get('downloadPDFViaBrowser.onLoadTimeout');
// Technically this is not a download, but the full operation timeout
const downloadTimeout = 60e3;
const downloadTimeout = Zotero.Prefs.get('downloadPDFViaBrowser.downloadTimeout');
let channelBrowser, hiddenBrowser;
let hiddenBrowserPDFFoundDeferred = Zotero.Promise.defer();

View file

@ -77,6 +77,9 @@ pref("extensions.zotero.sortCreatorAsString", false);
pref("extensions.zotero.tagSelector.showAutomatic", true);
pref("extensions.zotero.tagSelector.displayAllTags", false);
pref("extensions.zotero.downloadPDFViaBrowser.onLoadTimeout", 1500);
pref("extensions.zotero.downloadPDFViaBrowser.downloadTimeout", 60000);
// Keyboard shortcuts
pref("extensions.zotero.keys.saveToZotero", "S");
pref("extensions.zotero.keys.newItem", "N");