Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: issue-reporter.js

Issue 29595598: Issue 5967 - Don't rely on URLSearchParams() constructor to accept a sequence (Closed) Base URL: https://hg.adblockplus.org/adblockplusui/
Patch Set: Created Nov. 2, 2017, 1:44 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: issue-reporter.js
===================================================================
--- a/issue-reporter.js
+++ b/issue-reporter.js
@@ -398,22 +398,27 @@ function initSendPage()
let component = uuid[i].toString(16);
while (component.length < 4)
component = "0" + component;
uuidString += component;
if (i >= 1 && i <= 4)
uuidString += "-";
}
- let params = new URLSearchParams({
- version: 1,
- guid: uuidString,
- lang: reportData.getElementsByTagName("adblock-plus")[0]
- .getAttribute("locale")
- });
+ let params = new URLSearchParams();
+ 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
+ ["version", 1],
+ ["guid", uuidString],
+ ["lang", reportData.getElementsByTagName("adblock-plus")[0]
+ .getAttribute("locale")]
+ ])
+ {
+ params.append(param, value);
+ }
+
let url = "https://reports.adblockplus.org/submitReport?" + params;
let reportSent = event =>
{
let success = false;
let errorMessage = browser.i18n.getMessage(
"filters_subscription_lastDownload_connectionError"
);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld