| Index: issue-reporter.js |
| =================================================================== |
| --- a/issue-reporter.js |
| +++ b/issue-reporter.js |
| @@ -86,16 +86,21 @@ function censorURL(url) |
| return url.replace(/([?;&/#][^?;&/#]+?=)[^?;&/#]+/g, "$1*"); |
| } |
| function encodeHTML(str) |
| { |
| return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """); |
| } |
| +function capitalize(str) |
| +{ |
| + return str[0].toUpperCase() + str.slice(1); |
| +} |
| + |
| function serializeReportData() |
| { |
| let result = new XMLSerializer().serializeToString(reportData); |
| // Insert line breaks before each new tag |
| result = result.replace(/(<[^/]([^"<>]*|"[^"]*")*>)/g, "\n$1"); |
| result = result.replace(/^\n+/, ""); |
| return result; |
| @@ -124,38 +129,39 @@ function retrieveAddonInfo() |
| function retrieveApplicationInfo() |
| { |
| let element = reportData.createElement("application"); |
| return browser.runtime.sendMessage({ |
| type: "app.get", |
| what: "application" |
| }).then(application => |
| { |
| - element.setAttribute("name", application); |
| + element.setAttribute("name", capitalize(application)); |
| return browser.runtime.sendMessage({ |
| type: "app.get", |
| what: "applicationVersion" |
| }); |
| }).then(applicationVersion => |
| { |
| element.setAttribute("version", applicationVersion); |
| + element.setAttribute("vendor", navigator.vendor); |
| element.setAttribute("userAgent", navigator.userAgent); |
| reportData.documentElement.appendChild(element); |
| }); |
| } |
| function retrievePlatformInfo() |
| { |
| let element = reportData.createElement("platform"); |
| return browser.runtime.sendMessage({ |
| type: "app.get", |
| what: "platform" |
| }).then(platform => |
| { |
| - element.setAttribute("name", platform); |
| + element.setAttribute("name", capitalize(platform)); |
| return browser.runtime.sendMessage({ |
| type: "app.get", |
| what: "platformVersion" |
| }); |
| }).then(platformVersion => |
| { |
| element.setAttribute("version", platformVersion); |
| reportData.documentElement.appendChild(element); |