This is ugly, but I'd prefer it just so that we are sure about the tab that we are closing:

    let tab;
    open({
      url: url,
      onOpen: function(newTab) {
        tab = newTab;
      },
      inBackground: true // faster
    })

then

    complete(tab, srv, done);