LEFT | RIGHT |
1 /* This Source Code Form is subject to the terms of the Mozilla Public | 1 /* This Source Code Form is subject to the terms of the Mozilla Public |
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file, | 2 * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */ | 3 * You can obtain one at http://mozilla.org/MPL/2.0/. */ |
4 | 4 |
5 let {hook} = require("hooks"); | 5 let {hook} = require("hooks"); |
6 let functionHooks = new WeakMap(); | 6 let functionHooks = new WeakMap(); |
7 | 7 |
8 exports.removeFromWindow = function(window) | 8 exports.removeFromWindow = function(window) |
9 { | 9 { |
10 if (functionHooks.has(window)) | 10 if (functionHooks.has(window)) |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 }; | 117 }; |
118 | 118 |
119 let basicRemove = exports.removeFromWindow; | 119 let basicRemove = exports.removeFromWindow; |
120 exports.removeFromWindow = function(window) | 120 exports.removeFromWindow = function(window) |
121 { | 121 { |
122 basicRemove(window); | 122 basicRemove(window); |
123 | 123 |
124 if (eventListeners.has(window)) | 124 if (eventListeners.has(window)) |
125 { | 125 { |
126 let eventListener = eventListeners.get(window); | 126 let eventListener = eventListeners.get(window); |
127 eventListener.element.removeEventListener("command", eventListener.liste
ner, true); | 127 eventListener.element.removeEventListener("command", eventListener.liste
ner, true); |
| 128 eventListeners.delete(window); |
128 } | 129 } |
129 }; | 130 }; |
130 | 131 |
131 exports.openInfobar = function(window, id, message, buttons, persistence) | 132 exports.openInfobar = function(window, id, message, buttons, persistence) |
132 { | 133 { |
133 let browser = exports.getBrowser(window); | 134 let browser = exports.getBrowser(window); |
134 let infobar = browser.getNotificationBox(); | 135 let infobar = browser.getNotificationBox(); |
135 let notif = infobar.getNotificationWithValue(id); | 136 let notif = infobar.getNotificationWithValue(id); |
136 | 137 |
137 if (notif) | 138 if (notif) |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 }; | 286 }; |
286 | 287 |
287 break; | 288 break; |
288 } | 289 } |
289 default: | 290 default: |
290 { | 291 { |
291 exports.isKnownWindow = function(window) false; | 292 exports.isKnownWindow = function(window) false; |
292 break; | 293 break; |
293 } | 294 } |
294 } | 295 } |
LEFT | RIGHT |