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