Nit: Can non window be passed to this ? If answer is yes you should make sure it's `win instanceof nsIDOMWindow` if only windows are supposed to be passed then there is no point in testing if `win` is truthy.