Nit: you can actually do:
```js
close(e.target.defaultView).
  then(loader.unload).
  then(done)
```