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-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 18 matching lines...) Expand all Loading... |
29 } | 29 } |
30 catch (e) | 30 catch (e) |
31 { | 31 { |
32 Cu.reportError(e); | 32 Cu.reportError(e); |
33 } | 33 } |
34 | 34 |
35 let {XPCOMUtils} = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {}); | 35 let {XPCOMUtils} = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {}); |
36 let {Services} = Cu.import("resource://gre/modules/Services.jsm", {}); | 36 let {Services} = Cu.import("resource://gre/modules/Services.jsm", {}); |
37 | 37 |
38 let {shouldAllowAsync} = require("child/contentPolicy"); | 38 let {shouldAllowAsync} = require("child/contentPolicy"); |
39 let {getFrames, isPrivate} = require("child/utils"); | 39 let {getFrames, isPrivate, getRequestWindow} = require("child/utils"); |
40 let {RequestNotifier} = require("child/requestNotifier"); | 40 let {RequestNotifier} = require("child/requestNotifier"); |
41 let {port} = require("messaging"); | 41 let {port} = require("messaging"); |
42 let {Utils} = require("utils"); | 42 let {Utils} = require("utils"); |
43 | 43 |
44 const notImplemented = () => Cr.NS_ERROR_NOT_IMPLEMENTED; | 44 const notImplemented = () => Cr.NS_ERROR_NOT_IMPLEMENTED; |
45 | 45 |
46 /** | 46 /** |
47 * about: URL module used to count hits. | 47 * about: URL module used to count hits. |
48 * @class | 48 * @class |
49 */ | 49 */ |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 BaseChannel.call(this, uri, loadInfo); | 261 BaseChannel.call(this, uri, loadInfo); |
262 this.key = key; | 262 this.key = key; |
263 } | 263 } |
264 HitRegistrationChannel.prototype = { | 264 HitRegistrationChannel.prototype = { |
265 __proto__: BaseChannel.prototype, | 265 __proto__: BaseChannel.prototype, |
266 key: null, | 266 key: null, |
267 contentType: "text/xml", | 267 contentType: "text/xml", |
268 | 268 |
269 _getResponse: function() | 269 _getResponse: function() |
270 { | 270 { |
271 let window = Utils.getRequestWindow(this); | 271 let window = getRequestWindow(this); |
272 port.emitWithResponse("registerElemHideHit", { | 272 port.emitWithResponse("registerElemHideHit", { |
273 key: this.key, | 273 key: this.key, |
274 frames: getFrames(window), | 274 frames: getFrames(window), |
275 isPrivate: isPrivate(window) | 275 isPrivate: isPrivate(window) |
276 }).then(hit => | 276 }).then(hit => |
277 { | 277 { |
278 if (hit) | 278 if (hit) |
279 RequestNotifier.addNodeData(window.document, window.top, hit); | 279 RequestNotifier.addNodeData(window.document, window.top, hit); |
280 }); | 280 }); |
281 return "<bindings xmlns='http://www.mozilla.org/xbl'/>"; | 281 return "<bindings xmlns='http://www.mozilla.org/xbl'/>"; |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 else if (filter) | 382 else if (filter) |
383 { | 383 { |
384 RequestNotifier.addNodeData(window.document, window.top, { | 384 RequestNotifier.addNodeData(window.document, window.top, { |
385 contentType, docDomain, thirdParty, location, filter, filterType | 385 contentType, docDomain, thirdParty, location, filter, filterType |
386 }); | 386 }); |
387 } | 387 } |
388 }); | 388 }); |
389 } | 389 } |
390 }; | 390 }; |
391 observer.init(); | 391 observer.init(); |
OLD | NEW |