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: Added comment Created Nov. 3, 2017, 10:45 a.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,29 @@ 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")
- });
+ // Passing a sequence to URLSearchParams() constructor only works starting
+ // with Firefox 53, add values "manually" for now.
+ let params = new URLSearchParams();
+ for (let [param, value] of [
+ ["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