| Index: lib/windowObserver.js |
| =================================================================== |
| --- a/lib/windowObserver.js |
| +++ b/lib/windowObserver.js |
| @@ -1,24 +1,11 @@ |
| -/* |
| - * This file is part of the Adblock Plus build tools, |
| - * Copyright (C) 2006-2014 Eyeo GmbH |
| - * |
| - * Adblock Plus is free software: you can redistribute it and/or modify |
| - * it under the terms of the GNU General Public License version 3 as |
| - * published by the Free Software Foundation. |
| - * |
| - * Adblock Plus is distributed in the hope that it will be useful, |
| - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| - * GNU General Public License for more details. |
| - * |
| - * You should have received a copy of the GNU General Public License |
| - * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
| - */ |
| +/* This Source Code Form is subject to the terms of the Mozilla Public |
| + * License, v. 2.0. If a copy of the MPL was not distributed with this |
| + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| Cu.import("resource://gre/modules/Services.jsm"); |
| Cu.import("resource://gre/modules/XPCOMUtils.jsm"); |
| exports.WindowObserver = WindowObserver; |
| /** |
| * This class will call listener's method applyToWindow() for all new chrome |
| @@ -43,17 +30,17 @@ function WindowObserver(listener, when) |
| // Check if there are any windows that we missed |
| let eAll = Services.ww.getWindowEnumerator(); |
| while (eAll.hasMoreElements()) |
| { |
| let element = eAll.getNext(); |
| if (windows.indexOf(element) < 0) |
| windows.push(element); |
| } |
| - |
| + |
| for (let i = 0; i < windows.length; i++) |
| { |
| let window = windows[i].QueryInterface(Ci.nsIDOMWindow); |
| if (when == "start" || window.document.readyState == "complete") |
| this._listener.applyToWindow(window); |
| else |
| this.observe(window, "chrome-document-global-created", null); |
| } |