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 |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 // Ignore fragment identifier | 250 // Ignore fragment identifier |
251 let index = url.indexOf("#"); | 251 let index = url.indexOf("#"); |
252 if (index >= 0) | 252 if (index >= 0) |
253 url = url.substring(0, index); | 253 url = url.substring(0, index); |
254 | 254 |
255 let result = defaultMatcher.matchesAny(url, RegExpFilter.typeMap.DOCUMENT, g
etHostname(parentUrl), false, sitekey); | 255 let result = defaultMatcher.matchesAny(url, RegExpFilter.typeMap.DOCUMENT, g
etHostname(parentUrl), false, sitekey); |
256 return (result instanceof WhitelistFilter ? result : null); | 256 return (result instanceof WhitelistFilter ? result : null); |
257 }, | 257 }, |
258 | 258 |
259 /** | 259 /** |
260 * Checks whether the page loaded in a window is whitelisted for indication in
the UI. | |
261 * @param wnd {nsIDOMWindow} | |
262 * @return {Filter} matching exception rule or null if not whitelisted | |
263 */ | |
264 isWindowWhitelisted: function(wnd) | |
265 { | |
266 return this.isWhitelisted(getWindowLocation(wnd)); | |
267 }, | |
268 | |
269 /** | |
270 * Deletes nodes that were previously stored with a | 260 * Deletes nodes that were previously stored with a |
271 * RequestNotifier.storeNodesForEntries() call or similar. | 261 * RequestNotifier.storeNodesForEntries() call or similar. |
272 * @param {string} id unique ID of the nodes | 262 * @param {string} id unique ID of the nodes |
273 */ | 263 */ |
274 deleteNodes: function(id) | 264 deleteNodes: function(id) |
275 { | 265 { |
276 let messageManager = Cc["@mozilla.org/parentprocessmessagemanager;1"] | 266 let messageManager = Cc["@mozilla.org/parentprocessmessagemanager;1"] |
277 .getService(Ci.nsIMessageBroadcaster); | 267 .getService(Ci.nsIMessageBroadcaster); |
278 messageManager.broadcastAsyncMessage("AdblockPlus:DeleteNodes", id); | 268 messageManager.broadcastAsyncMessage("AdblockPlus:DeleteNodes", id); |
279 }, | 269 }, |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 { | 390 { |
401 // EffectiveTLDService throws on IP addresses, just compare the host name | 391 // EffectiveTLDService throws on IP addresses, just compare the host name |
402 let host = ""; | 392 let host = ""; |
403 try | 393 try |
404 { | 394 { |
405 host = uri.host; | 395 host = uri.host; |
406 } catch (e) {} | 396 } catch (e) {} |
407 return host != docDomain; | 397 return host != docDomain; |
408 } | 398 } |
409 } | 399 } |
OLD | NEW |