OLD | NEW |
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 |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU General Public License | 14 * You should have received a copy of the GNU General Public License |
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. | 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
16 */ | 16 */ |
17 | 17 |
| 18 /** @module whitelisting */ |
| 19 |
18 let {defaultMatcher} = require("matcher"); | 20 let {defaultMatcher} = require("matcher"); |
19 let {stringifyURL, getDecodedHostname, extractHostFromFrame, isThirdParty} = req
uire("url"); | 21 let {stringifyURL, getDecodedHostname, extractHostFromFrame, isThirdParty} = req
uire("url"); |
20 | 22 |
21 let pagesWithKey = new ext.PageMap(); | 23 let pagesWithKey = new ext.PageMap(); |
22 | 24 |
23 /** | 25 /** |
24 * Checks whether a page is whitelisted. | 26 * Checks whether a page is whitelisted. |
25 * | 27 * |
26 * @param {Page} page | 28 * @param {Page} page |
27 * @return {WhitelistFilter} The active filter whitelisting this page or null | 29 * @return {WhitelistFilter} The active filter whitelisting this page or null |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 if (token.indexOf("_") < 0) | 137 if (token.indexOf("_") < 0) |
136 return; | 138 return; |
137 | 139 |
138 let [key, signature] = token.split("_", 2); | 140 let [key, signature] = token.split("_", 2); |
139 key = key.replace(/=/g, ""); | 141 key = key.replace(/=/g, ""); |
140 | 142 |
141 if (verifyKey(key, signature, frame.url)) | 143 if (verifyKey(key, signature, frame.url)) |
142 recordKey(page, frame.url, key); | 144 recordKey(page, frame.url, key); |
143 } | 145 } |
144 exports.processKey = processKey; | 146 exports.processKey = processKey; |
OLD | NEW |