summaryrefslogtreecommitdiff
path: root/data/extensions/spyblock@gnu.org/lib/downloader.js
diff options
context:
space:
mode:
Diffstat (limited to 'data/extensions/spyblock@gnu.org/lib/downloader.js')
-rw-r--r--data/extensions/spyblock@gnu.org/lib/downloader.js19
1 files changed, 16 insertions, 3 deletions
diff --git a/data/extensions/spyblock@gnu.org/lib/downloader.js b/data/extensions/spyblock@gnu.org/lib/downloader.js
index d1ef209..320a754 100644
--- a/data/extensions/spyblock@gnu.org/lib/downloader.js
+++ b/data/extensions/spyblock@gnu.org/lib/downloader.js
@@ -1,6 +1,6 @@
/*
- * This file is part of Adblock Plus <http://adblockplus.org/>,
- * Copyright (C) 2006-2014 Eyeo GmbH
+ * This file is part of Adblock Plus <https://adblockplus.org/>,
+ * Copyright (C) 2006-2015 Eyeo GmbH
*
* Adblock Plus is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
@@ -191,13 +191,18 @@ Downloader.prototype =
url += "&";
else
url += "?";
+ // We limit the download count to 4+ to keep the request anonymized
+ let downloadCount = downloadable.downloadCount;
+ if (downloadCount > 4)
+ downloadCount = "4+";
url += "addonName=" + encodeURIComponent(addonName) +
"&addonVersion=" + encodeURIComponent(addonVersion) +
"&application=" + encodeURIComponent(application) +
"&applicationVersion=" + encodeURIComponent(applicationVersion) +
"&platform=" + encodeURIComponent(platform) +
"&platformVersion=" + encodeURIComponent(platformVersion) +
- "&lastVersion=" + encodeURIComponent(downloadable.lastVersion);
+ "&lastVersion=" + encodeURIComponent(downloadable.lastVersion) +
+ "&downloadCount=" + encodeURIComponent(downloadCount);
return url;
},
@@ -291,6 +296,8 @@ Downloader.prototype =
return;
}
+ downloadable.downloadCount++;
+
this.onDownloadSuccess(downloadable, request.responseText, errorCallback, function redirectCallback(url)
{
if (redirects >= this.maxRedirects)
@@ -378,4 +385,10 @@ Downloadable.prototype =
* @type Integer
*/
hardExpiration: 0,
+
+ /**
+ * Number indicating how often the object was downloaded.
+ * @type Integer
+ */
+ downloadCount: 0,
};