| 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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 // Populate types map | 239 // Populate types map |
| 240 let iface = Ci.nsIContentPolicy; | 240 let iface = Ci.nsIContentPolicy; |
| 241 for (let name in iface) | 241 for (let name in iface) |
| 242 if (name.indexOf("TYPE_") == 0 && name != "TYPE_DATAREQUEST") | 242 if (name.indexOf("TYPE_") == 0 && name != "TYPE_DATAREQUEST") |
| 243 types.set(iface[name], name.substr(5)); | 243 types.set(iface[name], name.substr(5)); |
| 244 | 244 |
| 245 let registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar); | 245 let registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar); |
| 246 registrar.registerFactory(this.classID, this.classDescription, this.contract
ID, this); | 246 registrar.registerFactory(this.classID, this.classDescription, this.contract
ID, this); |
| 247 | 247 |
| 248 let catMan = Utils.categoryManager; | 248 let catMan = Utils.categoryManager; |
| 249 let addCategoryEntry = Utils.getPropertyWithoutCompatShims(catMan, "addCateg
oryEntry"); | |
| 250 for (let category of this.xpcom_categories) | 249 for (let category of this.xpcom_categories) |
| 251 addCategoryEntry.call(catMan, category, this.contractID, this.contractID,
false, true); | 250 catMan.addCategoryEntry(category, this.contractID, this.contractID, false,
true); |
| 252 | 251 |
| 253 let addObserver = Utils.getPropertyWithoutCompatShims(Services.obs, "addObse
rver"); | 252 Services.obs.addObserver(this, "content-document-global-created", true); |
| 254 addObserver.call(Services.obs, this, "content-document-global-created", true
); | |
| 255 | 253 |
| 256 onShutdown.add(() => | 254 onShutdown.add(() => |
| 257 { | 255 { |
| 258 let removeObserver = Utils.getPropertyWithoutCompatShims(Services.obs, "re
moveObserver"); | 256 Services.obs.removeObserver(this, "content-document-global-created"); |
| 259 removeObserver.call(Services.obs, this, "content-document-global-created")
; | |
| 260 | 257 |
| 261 for (let category of this.xpcom_categories) | 258 for (let category of this.xpcom_categories) |
| 262 catMan.deleteCategoryEntry(category, this.contractID, false); | 259 catMan.deleteCategoryEntry(category, this.contractID, false); |
| 263 | 260 |
| 264 registrar.unregisterFactory(this.classID, this); | 261 registrar.unregisterFactory(this.classID, this); |
| 265 }); | 262 }); |
| 266 }, | 263 }, |
| 267 | 264 |
| 268 // | 265 // |
| 269 // nsISupports interface implementation | 266 // nsISupports interface implementation |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 let property = (hasCols ? "cols" : "rows"); | 463 let property = (hasCols ? "cols" : "rows"); |
| 467 let weights = parentNode[property].split(","); | 464 let weights = parentNode[property].split(","); |
| 468 weights[index] = "0"; | 465 weights[index] = "0"; |
| 469 parentNode[property] = weights.join(","); | 466 parentNode[property] = weights.join(","); |
| 470 } | 467 } |
| 471 } | 468 } |
| 472 else | 469 else |
| 473 node.classList.add(collapsedClass); | 470 node.classList.add(collapsedClass); |
| 474 } | 471 } |
| 475 } | 472 } |
| OLD | NEW |