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

Side by Side Diff: background.js

Issue 4515985834901504: Issue 2664 - Remove ignoreHeaders argument from parseFilter(s) and move the logic to the UI (Closed)
Patch Set: Exclude filter list header errors using .forEach() Created June 8, 2015, 6:36 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 | lib/filterValidation.js » ('j') | 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-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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 // The browser action popup asks us this. 363 // The browser action popup asks us this.
364 if(sender.page) 364 if(sender.page)
365 { 365 {
366 sendResponse({enabled: !isPageWhitelisted(sender.page)}); 366 sendResponse({enabled: !isPageWhitelisted(sender.page)});
367 return; 367 return;
368 } 368 }
369 break; 369 break;
370 case "add-filters": 370 case "add-filters":
371 var result = parseFilters(msg.text); 371 var result = parseFilters(msg.text);
372 372
373 if (result.error) 373 if (result.errors.length > 0)
374 { 374 {
375 sendResponse({status: "invalid", error: result.error}); 375 sendResponse({status: "invalid", error: result.errors.join("\n")});
376 break; 376 break;
377 } 377 }
378 378
379 for (var i = 0; i < result.filters.length; i++) 379 for (var i = 0; i < result.filters.length; i++)
380 FilterStorage.addFilter(result.filters[i]); 380 FilterStorage.addFilter(result.filters[i]);
381 381
382 sendResponse({status: "ok"}); 382 sendResponse({status: "ok"});
383 break; 383 break;
384 case "add-subscription": 384 case "add-subscription":
385 ext.showOptions(function(page) 385 ext.showOptions(function(page)
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 break; 422 break;
423 } 423 }
424 }); 424 });
425 425
426 // update icon when page changes location 426 // update icon when page changes location
427 ext.pages.onLoading.addListener(function(page) 427 ext.pages.onLoading.addListener(function(page)
428 { 428 {
429 page.sendMessage({type: "clickhide-deactivate"}); 429 page.sendMessage({type: "clickhide-deactivate"});
430 refreshIconAndContextMenu(page); 430 refreshIconAndContextMenu(page);
431 }); 431 });
OLDNEW
« no previous file with comments | « no previous file | lib/filterValidation.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld