LEFT | RIGHT |
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-present eyeo GmbH | 3 * Copyright (C) 2006-present 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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 ext.storage.get(prefs.map(prefToKey), items => | 309 ext.storage.get(prefs.map(prefToKey), items => |
310 { | 310 { |
311 for (let key in items) | 311 for (let key in items) |
312 overrides[keyToPref(key)] = items[key]; | 312 overrides[keyToPref(key)] = items[key]; |
313 | 313 |
314 if (require("info").platform == "gecko") | 314 if (require("info").platform == "gecko") |
315 { | 315 { |
316 let blockedTotal = window.localStorage.getItem("blocked_total"); | 316 let blockedTotal = window.localStorage.getItem("blocked_total"); |
317 if (typeof blockedTotal == "string") | 317 if (typeof blockedTotal == "string") |
318 { | 318 { |
319 blockedTotal = JSON.parse(blockedTotal); | 319 blockedTotal = parseInt(blockedTotal, 10); |
320 if (blockedTotal > overrides.blocked_total) | 320 if (blockedTotal > overrides.blocked_total) |
321 { | 321 { |
322 overrides.blocked_total = blockedTotal; | 322 overrides.blocked_total = blockedTotal; |
323 savePref("blocked_total"); | 323 savePref("blocked_total"); |
324 } | 324 } |
325 } | 325 } |
326 } | 326 } |
327 | 327 |
328 resolve(); | 328 resolve(); |
329 }); | 329 }); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 eventEmitter.emit(pref); | 371 eventEmitter.emit(pref); |
372 } | 372 } |
373 } | 373 } |
374 }); | 374 }); |
375 } | 375 } |
376 | 376 |
377 Prefs.untilLoaded = Promise.all([localLoaded, managedLoaded]).then(onLoaded); | 377 Prefs.untilLoaded = Promise.all([localLoaded, managedLoaded]).then(onLoaded); |
378 } | 378 } |
379 | 379 |
380 init(); | 380 init(); |
LEFT | RIGHT |