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-2015 Eyeo GmbH | 3 * Copyright (C) 2006-2015 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 function serializeReportData() | 63 function serializeReportData() |
64 { | 64 { |
65 let result = new XMLSerializer().serializeToString(reportData); | 65 let result = new XMLSerializer().serializeToString(reportData); |
66 | 66 |
67 // Insert line breaks before each new tag | 67 // Insert line breaks before each new tag |
68 result = result.replace(/(<[^\/]([^"<>]*|"[^"]*")*>)/g, "\n$1"); | 68 result = result.replace(/(<[^\/]([^"<>]*|"[^"]*")*>)/g, "\n$1"); |
69 result = result.replace(/^\n+/, ""); | 69 result = result.replace(/^\n+/, ""); |
70 return result; | 70 return result; |
71 } | 71 } |
72 | 72 |
73 let (element = reportElement("adblock-plus")) | |
74 { | 73 { |
| 74 let element = reportElement("adblock-plus"); |
75 let {addonVersion} = require("info"); | 75 let {addonVersion} = require("info"); |
76 element.setAttribute("version", addonVersion); | 76 element.setAttribute("version", addonVersion); |
77 element.setAttribute("locale", Utils.appLocale); | 77 element.setAttribute("locale", Utils.appLocale); |
78 }; | 78 } |
79 let (element = reportElement("application")) | |
80 { | 79 { |
| 80 let element = reportElement("application"); |
81 element.setAttribute("name", Services.appinfo.name); | 81 element.setAttribute("name", Services.appinfo.name); |
82 element.setAttribute("vendor", Services.appinfo.vendor); | 82 element.setAttribute("vendor", Services.appinfo.vendor); |
83 element.setAttribute("version", Services.appinfo.version); | 83 element.setAttribute("version", Services.appinfo.version); |
84 element.setAttribute("userAgent", window.navigator.userAgent); | 84 element.setAttribute("userAgent", window.navigator.userAgent); |
85 }; | 85 } |
86 let (element = reportElement("platform")) | |
87 { | 86 { |
| 87 let element = reportElement("platform"); |
88 element.setAttribute("name", "Gecko"); | 88 element.setAttribute("name", "Gecko"); |
89 element.setAttribute("version", Services.appinfo.platformVersion); | 89 element.setAttribute("version", Services.appinfo.platformVersion); |
90 element.setAttribute("build", Services.appinfo.platformBuildID); | 90 element.setAttribute("build", Services.appinfo.platformBuildID); |
91 }; | 91 }; |
92 let (element = reportElement("options")) | |
93 { | 92 { |
| 93 let element = reportElement("options"); |
94 appendElement(element, "option", {id: "enabled"}, Prefs.enabled); | 94 appendElement(element, "option", {id: "enabled"}, Prefs.enabled); |
95 appendElement(element, "option", {id: "objecttabs"}, Prefs.frameobjects); | 95 appendElement(element, "option", {id: "objecttabs"}, Prefs.frameobjects); |
96 appendElement(element, "option", {id: "collapse"}, !Prefs.fastcollapse); | 96 appendElement(element, "option", {id: "collapse"}, !Prefs.fastcollapse); |
97 appendElement(element, "option", {id: "privateBrowsing"}, PrivateBrowsing.enab
ledForWindow(contentWindow) || PrivateBrowsing.enabled); | 97 appendElement(element, "option", {id: "privateBrowsing"}, PrivateBrowsing.enab
ledForWindow(contentWindow) || PrivateBrowsing.enabled); |
98 appendElement(element, "option", {id: "subscriptionsAutoUpdate"}, Prefs.subscr
iptions_autoupdate); | 98 appendElement(element, "option", {id: "subscriptionsAutoUpdate"}, Prefs.subscr
iptions_autoupdate); |
99 appendElement(element, "option", {id: "javascript"}, Services.prefs.getBoolPre
f("javascript.enabled")); | 99 appendElement(element, "option", {id: "javascript"}, Services.prefs.getBoolPre
f("javascript.enabled")); |
100 appendElement(element, "option", {id: "cookieBehavior"}, Services.prefs.getInt
Pref("network.cookie.cookieBehavior")); | 100 appendElement(element, "option", {id: "cookieBehavior"}, Services.prefs.getInt
Pref("network.cookie.cookieBehavior")); |
101 }; | 101 }; |
102 | 102 |
103 // | 103 // |
(...skipping 1473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1577 | 1577 |
1578 function censorURL(url) | 1578 function censorURL(url) |
1579 { | 1579 { |
1580 return url.replace(/([?;&\/#][^?;&\/#]+?=)[^?;&\/#]+/g, "$1*"); | 1580 return url.replace(/([?;&\/#][^?;&\/#]+?=)[^?;&\/#]+/g, "$1*"); |
1581 } | 1581 } |
1582 | 1582 |
1583 function encodeHTML(str) | 1583 function encodeHTML(str) |
1584 { | 1584 { |
1585 return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").
replace(/"/g, """); | 1585 return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").
replace(/"/g, """); |
1586 } | 1586 } |
OLD | NEW |