aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorgorhill <rhill@raymondhill.net>2015-09-25 08:31:46 -0400
committergorhill <rhill@raymondhill.net>2015-09-25 08:31:46 -0400
commitde2d993d61d9d0449019de58eb484c877b122584 (patch)
treedf40b6d0cc8d31ce8c95d51e8229044abb6722db /src
parent69d4a0aa0ac8fd87412292894e2b5948a5861907 (diff)
downloaduBlock-de2d993d61d9d0449019de58eb484c877b122584.zip
uBlock-de2d993d61d9d0449019de58eb484c877b122584.tar.gz
uBlock-de2d993d61d9d0449019de58eb484c877b122584.tar.bz2
re. #724: configurable xhr timeout
Diffstat (limited to 'src')
-rw-r--r--src/js/assets.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/js/assets.js b/src/js/assets.js
index 8549cd8..d26d04c 100644
--- a/src/js/assets.js
+++ b/src/js/assets.js
@@ -61,6 +61,7 @@ var lastRepoMetaTimestamp = 0;
var lastRepoMetaIsRemote = false;
var refreshRepoMetaPeriod = 5 * oneHour;
var errorCantConnectTo = vAPI.i18n('errorCantConnectTo');
+var xhrTimeout = vAPI.localStorage.getItem('xhrTimeout') || 30000;
var exports = {
autoUpdate: true,
@@ -318,7 +319,7 @@ var getTextFileFromURL = function(url, onLoad, onError) {
var xhr = new XMLHttpRequest();
try {
xhr.open('get', url, true);
- xhr.timeout = 30000;
+ xhr.timeout = xhrTimeout;
xhr.onload = onResponseReceived;
xhr.onerror = onErrorReceived;
xhr.ontimeout = onErrorReceived;