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

Side by Side Diff: messageResponder.js

Issue 29337878: Issue 3736 - Fixed: Checks for share resources failed (Closed)
Patch Set: Rebased and added RegExpFilter mock Created March 14, 2016, 3:48 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 | « background.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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 case "filters.add": 185 case "filters.add":
186 var result = require("filterValidation").parseFilter(message.text); 186 var result = require("filterValidation").parseFilter(message.text);
187 var errors = []; 187 var errors = [];
188 if (result.error) 188 if (result.error)
189 errors.push(result.error.toString()); 189 errors.push(result.error.toString());
190 else if (result.filter) 190 else if (result.filter)
191 FilterStorage.addFilter(result.filter); 191 FilterStorage.addFilter(result.filter);
192 callback(errors); 192 callback(errors);
193 break; 193 break;
194 case "filters.blocked": 194 case "filters.blocked":
195 var filter = defaultMatcher.matchesAny(message.url, message.requestType, 195 var filter = defaultMatcher.matchesAny(message.url,
196 message.docDomain, message.thirdParty); 196 RegExpFilter.typeMap[message.requestType], message.docDomain,
197 message.thirdParty);
197 callback(filter instanceof BlockingFilter); 198 callback(filter instanceof BlockingFilter);
198 break; 199 break;
199 case "filters.get": 200 case "filters.get":
200 if (message.what == "cssproperties") 201 if (message.what == "cssproperties")
201 { 202 {
202 var filters = []; 203 var filters = [];
203 var checkWhitelisted = require("whitelisting").checkWhitelisted; 204 var checkWhitelisted = require("whitelisting").checkWhitelisted;
204 205
205 if (!checkWhitelisted(sender.page, sender.frame, 206 if (!checkWhitelisted(sender.page, sender.frame,
206 RegExpFilter.typeMap.DOCUMENT | 207 RegExpFilter.typeMap.DOCUMENT |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 if (subscription instanceof DownloadableSubscription) 363 if (subscription instanceof DownloadableSubscription)
363 Synchronizer.execute(subscription, true); 364 Synchronizer.execute(subscription, true);
364 } 365 }
365 break; 366 break;
366 case "subscriptions.isDownloading": 367 case "subscriptions.isDownloading":
367 callback(Synchronizer.isExecuting(message.url)); 368 callback(Synchronizer.isExecuting(message.url));
368 break; 369 break;
369 } 370 }
370 }); 371 });
371 })(this); 372 })(this);
OLDNEW
« no previous file with comments | « background.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld