With just one event we no longer need a function stored, we can just define it inline:

```javascript
window.addEventListener('appopen', function appOpen() {
  window.removeEventListener('appopen', appOpen);
  waitFor(
    function() {
      console.log("app with origin '" + origin + "' has launched");
      sendResponse();
    },
    function() {
      origin = GaiaApps.getRunningAppOrigin(appName);
      return manager.getDisplayedApp() == origin;
    }
  );
});