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

Side by Side Diff: lib/synchronizer.js

Issue 29339343: Noissue - Removed redundant URL compatibility logic (Closed)
Patch Set: Use hostname Created April 4, 2016, 2:04 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
« lib/notification.js ('K') | « lib/notification.js ('k') | no next file » | no next file with comments »
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-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 subscription.downloadCount = downloadable.downloadCount; 199 subscription.downloadCount = downloadable.downloadCount;
200 subscription.errors = 0; 200 subscription.errors = 0;
201 201
202 // Remove lines containing parameters 202 // Remove lines containing parameters
203 for (let i = remove.length - 1; i >= 0; i--) 203 for (let i = remove.length - 1; i >= 0; i--)
204 lines.splice(remove[i], 1); 204 lines.splice(remove[i], 1);
205 205
206 // Process parameters 206 // Process parameters
207 if (params.homepage) 207 if (params.homepage)
208 { 208 {
209 let uri = Utils.makeURI(params.homepage); 209 let url;
210 if (uri && (uri.scheme == "http" || uri.scheme == "https")) 210 try
211 subscription.homepage = uri.spec; 211 {
212 url = new URL(params.homepage);
213 }
214 catch (e)
215 {
216 url = null;
217 }
218
219 if (url && (url.protocol == "http" || url.protocol == "https"))
220 subscription.homepage = url.href;
212 } 221 }
213 222
214 if (params.title) 223 if (params.title)
215 { 224 {
216 subscription.title = params.title; 225 subscription.title = params.title;
217 subscription.fixedTitle = true; 226 subscription.fixedTitle = true;
218 } 227 }
219 else 228 else
220 subscription.fixedTitle = false; 229 subscription.fixedTitle = false;
221 230
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 let data = "[Adblock]\n" + subscription.filters.map((f) => f.text).j oin("\n"); 315 let data = "[Adblock]\n" + subscription.filters.map((f) => f.text).j oin("\n");
307 redirectCallback("data:text/plain," + encodeURIComponent(data)); 316 redirectCallback("data:text/plain," + encodeURIComponent(data));
308 } 317 }
309 }, false); 318 }, false);
310 request.send(null); 319 request.send(null);
311 } 320 }
312 } 321 }
313 }, 322 },
314 }; 323 };
315 Synchronizer.init(); 324 Synchronizer.init();
OLDNEW
« lib/notification.js ('K') | « lib/notification.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld