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-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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 /** | 57 /** |
58 * Creates a notifier object for a particular window. After creation the window | 58 * Creates a notifier object for a particular window. After creation the window |
59 * will first be scanned for previously saved requests. Once that scan is | 59 * will first be scanned for previously saved requests. Once that scan is |
60 * complete only new requests for this window will be reported. | 60 * complete only new requests for this window will be reported. |
61 * @param {Integer} outerWindowID ID of the window to attach the notifier to | 61 * @param {Integer} outerWindowID ID of the window to attach the notifier to |
62 * @param {Function} listener listener to be called whenever a new request is f
ound | 62 * @param {Function} listener listener to be called whenever a new request is f
ound |
63 * @param {Object} [listenerObj] "this" pointer to be used when calling the lis
tener | 63 * @param {Object} [listenerObj] "this" pointer to be used when calling the lis
tener |
64 */ | 64 */ |
65 function RequestNotifier(outerWindowID, listener, listenerObj) | 65 function RequestNotifier(outerWindowID, listener, listenerObj) |
66 { | 66 { |
67 this.outerWindowID = outerWindowID; | |
68 this.listener = listener; | 67 this.listener = listener; |
69 this.listenerObj = listenerObj || null; | 68 this.listenerObj = listenerObj || null; |
70 this.id = ++requestNotifierMaxId; | 69 this.id = ++requestNotifierMaxId; |
71 notifiers.set(this.id, this); | 70 notifiers.set(this.id, this); |
72 | 71 |
73 messageManager.broadcastAsyncMessage("AdblockPlus:StartWindowScan", { | 72 messageManager.broadcastAsyncMessage("AdblockPlus:StartWindowScan", { |
74 notifierID: this.id, | 73 notifierID: this.id, |
75 outerWindowID: this.outerWindowID | 74 outerWindowID: outerWindowID |
76 }); | 75 }); |
77 } | 76 } |
78 exports.RequestNotifier = RequestNotifier; | 77 exports.RequestNotifier = RequestNotifier; |
79 | 78 |
80 RequestNotifier.prototype = | 79 RequestNotifier.prototype = |
81 { | 80 { |
82 /** | 81 /** |
83 * The unique ID of this notifier. | 82 * The unique ID of this notifier. |
84 * @type Integer | 83 * @type Integer |
85 */ | 84 */ |
86 id: null, | 85 id: null, |
87 | |
88 /** | |
89 * The ID of the window this notifier is associated with. | |
90 * @type Integer | |
91 */ | |
92 outerWindowID: null, | |
93 | 86 |
94 /** | 87 /** |
95 * The listener to be called when a new request is found. | 88 * The listener to be called when a new request is found. |
96 * @type Function | 89 * @type Function |
97 */ | 90 */ |
98 listener: null, | 91 listener: null, |
99 | 92 |
100 /** | 93 /** |
101 * "this" pointer to be used when calling the listener. | 94 * "this" pointer to be used when calling the listener. |
102 * @type Object | 95 * @type Object |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 node = node.parentNode; | 190 node = node.parentNode; |
198 } | 191 } |
199 else | 192 else |
200 { | 193 { |
201 node = null; | 194 node = null; |
202 } | 195 } |
203 } | 196 } |
204 | 197 |
205 return null; | 198 return null; |
206 }; | 199 }; |
LEFT | RIGHT |