segment-boneyard/nightmare

feature: add nightmare.cookies.flush()

Open

#1.395 geöffnet am 28. Feb. 2018

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (1.076 Forks)batch import
3.xFeature RequestHelp Wanted

Repository-Metriken

Stars
 (19.507 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

Based on our discussion in #1296, it'd be good to support: await nightmare.cookies.flush().

That would involve adding the action to action.js along with some tests. Here's the custom action it would be based on:

// try to flush the session data
function CookieFlusher(Nightmare) {
  Nightmare.action(
    'flushCookies',
    (name, options, parent, win, renderer, done) => {
      parent.respondTo('flushCookies', done => {
        win.webContents.session.cookies.flushStore(done)
      })
      done()
    },
    function(done) {
      this.child.call('flushCookies', done)
    }
  )
}

Contributor Guide