| 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 // Passing a sequence to URLSearchParams() constructor only works starting |
| 407 version: 1, | 407 // with Firefox 53, add values "manually" for now. |
| 408 guid: uuidString, | 408 let params = new URLSearchParams(); |
| 409 lang: reportData.getElementsByTagName("adblock-plus")[0] | 409 for (let [param, value] of [ |
| 410 .getAttribute("locale") | 410 ["version", 1], |
| 411 }); | 411 ["guid", uuidString], |
| 412 ["lang", reportData.getElementsByTagName("adblock-plus")[0] |
| 413 .getAttribute("locale")] |
| 414 ]) |
| 415 { |
| 416 params.append(param, value); |
| 417 } |
| 418 |
| 412 let url = "https://reports.adblockplus.org/submitReport?" + params; | 419 let url = "https://reports.adblockplus.org/submitReport?" + params; |
| 413 | 420 |
| 414 let reportSent = event => | 421 let reportSent = event => |
| 415 { | 422 { |
| 416 let success = false; | 423 let success = false; |
| 417 let errorMessage = browser.i18n.getMessage( | 424 let errorMessage = browser.i18n.getMessage( |
| 418 "filters_subscription_lastDownload_connectionError" | 425 "filters_subscription_lastDownload_connectionError" |
| 419 ); | 426 ); |
| 420 try | 427 try |
| 421 { | 428 { |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 progress.value = event.loaded; | 509 progress.value = event.loaded; |
| 503 } | 510 } |
| 504 }); | 511 }); |
| 505 request.send(serializeReportData()); | 512 request.send(serializeReportData()); |
| 506 } | 513 } |
| 507 | 514 |
| 508 function leaveSendPage() | 515 function leaveSendPage() |
| 509 { | 516 { |
| 510 closeMe(); | 517 closeMe(); |
| 511 } | 518 } |
| OLD | NEW |