| OLD | NEW |
| 1 /* | 1 /* |
| 2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
| 3 * Copyright (C) 2006-2017 eyeo GmbH | 3 * Copyright (C) 2006-2017 eyeo GmbH |
| 4 * | 4 * |
| 5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
| 6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
| 7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
| 8 * | 8 * |
| 9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 } | 42 } |
| 43 let url = updateUrl.replace(/%TYPE%/g, forceCheck ? TYPE_MANUAL : TYPE_AUTOMAT
IC); | 43 let url = updateUrl.replace(/%TYPE%/g, forceCheck ? TYPE_MANUAL : TYPE_AUTOMAT
IC); |
| 44 let downloadable = new Downloadable(url); | 44 let downloadable = new Downloadable(url); |
| 45 downloadable.lastError = Prefs.update_last_error; | 45 downloadable.lastError = Prefs.update_last_error; |
| 46 downloadable.lastCheck = Prefs.update_last_check; | 46 downloadable.lastCheck = Prefs.update_last_check; |
| 47 downloadable.softExpiration = Prefs.update_soft_expiration; | 47 downloadable.softExpiration = Prefs.update_soft_expiration; |
| 48 downloadable.hardExpiration = Prefs.update_hard_expiration; | 48 downloadable.hardExpiration = Prefs.update_hard_expiration; |
| 49 return downloadable; | 49 return downloadable; |
| 50 } | 50 } |
| 51 | 51 |
| 52 function getDownloadables() | 52 function* getDownloadables() |
| 53 { | 53 { |
| 54 yield getDownloadable(false); | 54 yield getDownloadable(false); |
| 55 } | 55 } |
| 56 | 56 |
| 57 function onExpirationChange(downloadable) | 57 function onExpirationChange(downloadable) |
| 58 { | 58 { |
| 59 Prefs.update_last_check = downloadable.lastCheck; | 59 Prefs.update_last_check = downloadable.lastCheck; |
| 60 Prefs.update_soft_expiration = downloadable.softExpiration; | 60 Prefs.update_soft_expiration = downloadable.softExpiration; |
| 61 Prefs.update_hard_expiration = downloadable.hardExpiration; | 61 Prefs.update_hard_expiration = downloadable.hardExpiration; |
| 62 } | 62 } |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 if (callback) | 100 if (callback) |
| 101 callback(error); | 101 callback(error); |
| 102 callback = null; | 102 callback = null; |
| 103 } | 103 } |
| 104 | 104 |
| 105 let checkForUpdates = exports.checkForUpdates = function checkForUpdates(_callba
ck) | 105 let checkForUpdates = exports.checkForUpdates = function checkForUpdates(_callba
ck) |
| 106 { | 106 { |
| 107 callback = _callback; | 107 callback = _callback; |
| 108 downloader.download(getDownloadable(true)); | 108 downloader.download(getDownloadable(true)); |
| 109 } | 109 } |
| OLD | NEW |