| Left: | ||
| Right: |
| LEFT | RIGHT |
|---|---|
| 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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 189 { | 189 { |
| 190 let whitelistedWebsites = []; | 190 let whitelistedWebsites = []; |
| 191 for (let i = 0; i < FilterStorage.subscriptions.length; i++) | 191 for (let i = 0; i < FilterStorage.subscriptions.length; i++) |
| 192 { | 192 { |
| 193 let subscription = FilterStorage.subscriptions[i]; | 193 let subscription = FilterStorage.subscriptions[i]; |
| 194 if (subscription.url && subscription.url.startsWith("~user~") && subscript ion.filters) | 194 if (subscription.url && subscription.url.startsWith("~user~") && subscript ion.filters) |
| 195 { | 195 { |
| 196 for (let j = 0; j < subscription.filters.length; j++) | 196 for (let j = 0; j < subscription.filters.length; j++) |
| 197 { | 197 { |
| 198 let filter = subscription.filters[j]; | 198 let filter = subscription.filters[j]; |
| 199 let whitelistMatch = filter.text ? filter.text.match(/@@\|\|(.*)\^\$do cument/) : null; | 199 let whitelistMatch = filter.text ? filter.text.match(/^@@\|\|([^/:]+)\ ^\$document$/) : null; |
|
Thomas Greiner
2017/09/15 15:08:06
We're using a slightly different regular expressio
diegocarloslima
2017/09/18 14:16:36
Acknowledged.
| |
| 200 if(whitelistMatch) | 200 if(whitelistMatch) |
| 201 { | 201 { |
| 202 whitelistedWebsites.push({"url": whitelistMatch[1]}) | 202 whitelistedWebsites.push({"url": whitelistMatch[1]}) |
| 203 } | 203 } |
| 204 } | 204 } |
| 205 } | 205 } |
| 206 } | 206 } |
| 207 return whitelistedWebsites; | 207 return whitelistedWebsites; |
| 208 }, | 208 }, |
| 209 isWebsiteWhitelisted: function(url, host) | 209 isWebsiteWhitelisted: function(url, host) |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 307 { | 307 { |
| 308 this.whitelistWebsite(data["url"], data["host"], data["whitelisted"] ); | 308 this.whitelistWebsite(data["url"], data["host"], data["whitelisted"] ); |
| 309 return {"success": true}; | 309 return {"success": true}; |
| 310 } | 310 } |
| 311 break; | 311 break; |
| 312 } | 312 } |
| 313 return {"success": false, "error": "malformed request"}; | 313 return {"success": false, "error": "malformed request"}; |
| 314 }).bind(this), "AdblockPlus:Api"); | 314 }).bind(this), "AdblockPlus:Api"); |
| 315 } | 315 } |
| 316 }; | 316 }; |
| LEFT | RIGHT |