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

Side by Side Diff: issue-reporter.js

Issue 29587637: Issue 5891 - Add missing subscription information to issue reporter (Closed) Base URL: https://hg.adblockplus.org/adblockplusui/
Patch Set: Created Oct. 24, 2017, 12:40 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | messageResponder.js » ('j') | messageResponder.js » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 element.setAttribute("url", censorURL(tab.url)); 177 element.setAttribute("url", censorURL(tab.url));
178 reportData.documentElement.appendChild(element); 178 reportData.documentElement.appendChild(element);
179 }); 179 });
180 } 180 }
181 181
182 function retrieveSubscriptions() 182 function retrieveSubscriptions()
183 { 183 {
184 return browser.runtime.sendMessage({ 184 return browser.runtime.sendMessage({
185 type: "subscriptions.get", 185 type: "subscriptions.get",
186 ignoreDisabled: true, 186 ignoreDisabled: true,
187 downloadable: true 187 downloadable: true,
188 disabledFilters: true
188 }).then(subscriptions => 189 }).then(subscriptions =>
189 { 190 {
190 let element = reportData.createElement("subscriptions"); 191 let element = reportData.createElement("subscriptions");
191 for (let subscription of subscriptions) 192 for (let subscription of subscriptions)
192 { 193 {
193 if (!/^(http|https|ftp):/.test(subscription.url)) 194 if (!/^(http|https|ftp):/.test(subscription.url))
194 continue; 195 continue;
195 196
196 let now = Math.round(Date.now() / 1000); 197 let now = Math.round(Date.now() / 1000);
197 let subscriptionElement = reportData.createElement("subscription"); 198 let subscriptionElement = reportData.createElement("subscription");
198 subscriptionElement.setAttribute("id", subscription.url); 199 subscriptionElement.setAttribute("id", subscription.url);
200 if (subscription.version)
201 subscriptionElement.setAttribute("version", subscription.version);
199 if (subscription.lastDownload) 202 if (subscription.lastDownload)
200 { 203 {
201 subscriptionElement.setAttribute("lastDownloadAttempt", 204 subscriptionElement.setAttribute("lastDownloadAttempt",
202 subscription.lastDownload - now); 205 subscription.lastDownload - now);
203 } 206 }
207 if (subscription.lastSuccess)
208 {
209 subscriptionElement.setAttribute("lastDownloadSuccess",
210 subscription.lastSuccess - now);
211 }
212 if (subscription.softExpiration)
213 {
214 subscriptionElement.setAttribute("softExpiration",
215 subscription.softExpiration - now);
216 }
217 if (subscription.expires)
218 {
219 subscriptionElement.setAttribute("hardExpiration",
220 subscription.expires - now);
221 }
204 subscriptionElement.setAttribute("downloadStatus", 222 subscriptionElement.setAttribute("downloadStatus",
205 subscription.downloadStatus); 223 subscription.downloadStatus);
224 subscriptionElement.setAttribute("disabledFilters",
225 subscription.disabledFilters.length);
206 element.appendChild(subscriptionElement); 226 element.appendChild(subscriptionElement);
207 } 227 }
208 reportData.documentElement.appendChild(element); 228 reportData.documentElement.appendChild(element);
209 }); 229 });
210 } 230 }
211 231
212 function initDataCollector() 232 function initDataCollector()
213 { 233 {
214 Promise.resolve().then(() => 234 Promise.resolve().then(() =>
215 { 235 {
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 progress.value = event.loaded; 494 progress.value = event.loaded;
475 } 495 }
476 }); 496 });
477 request.send(serializeReportData()); 497 request.send(serializeReportData());
478 } 498 }
479 499
480 function leaveSendPage() 500 function leaveSendPage()
481 { 501 {
482 window.close(); 502 window.close();
483 } 503 }
OLDNEW
« no previous file with comments | « no previous file | messageResponder.js » ('j') | messageResponder.js » ('J')

Powered by Google App Engine
This is Rietveld