Left: | ||
Right: |
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-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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
396 for (let i = 0; i < uuid.length; i++) | 396 for (let i = 0; i < uuid.length; i++) |
397 { | 397 { |
398 let component = uuid[i].toString(16); | 398 let component = uuid[i].toString(16); |
399 while (component.length < 4) | 399 while (component.length < 4) |
400 component = "0" + component; | 400 component = "0" + component; |
401 uuidString += component; | 401 uuidString += component; |
402 if (i >= 1 && i <= 4) | 402 if (i >= 1 && i <= 4) |
403 uuidString += "-"; | 403 uuidString += "-"; |
404 } | 404 } |
405 | 405 |
406 let params = new URLSearchParams({ | 406 let params = new URLSearchParams(); |
407 version: 1, | 407 for (let [param, value] of [ |
kzar
2017/11/03 10:12:02
I can't remember, does array parameter destructuri
kzar
2017/11/03 10:12:03
Maybe add a comment explaining this is a workaroun
Wladimir Palant
2017/11/03 10:45:41
It does. That's part of the reason why we require
| |
408 guid: uuidString, | 408 ["version", 1], |
409 lang: reportData.getElementsByTagName("adblock-plus")[0] | 409 ["guid", uuidString], |
410 .getAttribute("locale") | 410 ["lang", reportData.getElementsByTagName("adblock-plus")[0] |
411 }); | 411 .getAttribute("locale")] |
412 ]) | |
413 { | |
414 params.append(param, value); | |
415 } | |
416 | |
412 let url = "https://reports.adblockplus.org/submitReport?" + params; | 417 let url = "https://reports.adblockplus.org/submitReport?" + params; |
413 | 418 |
414 let reportSent = event => | 419 let reportSent = event => |
415 { | 420 { |
416 let success = false; | 421 let success = false; |
417 let errorMessage = browser.i18n.getMessage( | 422 let errorMessage = browser.i18n.getMessage( |
418 "filters_subscription_lastDownload_connectionError" | 423 "filters_subscription_lastDownload_connectionError" |
419 ); | 424 ); |
420 try | 425 try |
421 { | 426 { |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
502 progress.value = event.loaded; | 507 progress.value = event.loaded; |
503 } | 508 } |
504 }); | 509 }); |
505 request.send(serializeReportData()); | 510 request.send(serializeReportData()); |
506 } | 511 } |
507 | 512 |
508 function leaveSendPage() | 513 function leaveSendPage() |
509 { | 514 { |
510 closeMe(); | 515 closeMe(); |
511 } | 516 } |
OLD | NEW |