Skip to content

Commit

Permalink
fix(plugin-user-data-dir): Use onDisconnect instead of onClose (#530)
Browse files Browse the repository at this point in the history
- Fixes #421 (freeze when using stealth on windows)
  • Loading branch information
dev-hyperweb committed Sep 17, 2021
1 parent 0049d60 commit 713f9fa
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/puppeteer-extra-plugin-user-data-dir/index.js
Expand Up @@ -6,9 +6,7 @@ const fse = require('fs-extra')
const os = require('os')
const path = require('path')
const debug = require('debug')('puppeteer-extra-plugin:user-data-dir')

const mkdtempAsync = util.promisify(fs.mkdtemp)

const { PuppeteerExtraPlugin } = require('puppeteer-extra-plugin')

/**
Expand Down Expand Up @@ -108,8 +106,8 @@ class Plugin extends PuppeteerExtraPlugin {
await this.writeFilesToProfile()
}

async onClose() {
debug('onClose')
async onDisconnected() {
debug('onDisconnected')
if (this.shouldDeleteDirectory) {
this.deleteUserDataDir()
}
Expand Down

0 comments on commit 713f9fa

Please sign in to comment.