mozilla / web-ext

A command line tool to help build, run, and test web extensions
Mozilla Public License 2.0
2.65k stars 334 forks source link

Firefox does not quit after Ctrl-C when using web-ext run #3134

Open 7003Mars opened 2 months ago

7003Mars commented 2 months ago

Is this a feature request or a bug?

Bug

What is the current behavior?

Running web-ext run --no-reload --start-url about:addons --source-dir ./dist -v and then pressing Ctrl-C gives the following error log

[firefox-profile] cannot delete profileDir on exit C:\Users\RAINBO~1\AppData\Local\Temp\firefox-profileHdw2uD/ Error: EBUSY: resource busy or locked, unlink 'C:\Users\RAINBO~1\AppData\Local\Temp\firefox-profileHdw2uD\cert9.db'
    at unlinkSync (node:fs:1875:11)
    at _unlinkSync (node:internal/fs/rimraf:214:14)
    at rimrafSync (node:internal/fs/rimraf:195:7)
    at node:internal/fs/rimraf:253:9
    at Array.forEach (<anonymous>)
    at _rmdirSync (node:internal/fs/rimraf:250:7)
    at rimrafSync (node:internal/fs/rimraf:193:7)
    at Object.rmSync (node:fs:1266:10)
    at FirefoxProfile._cleanOnExit (C:\Users\Rainbowhouse\WebstormProjects\midnight\node_modules\firefox-profile\lib\firefox_profile.js:292:12)
    at FirefoxProfile.onExit (C:\Users\Rainbowhouse\WebstormProjects\midnight\node_modules\firefox-profile\lib\firefox_profile.js:172:12) {
  errno: -4082,
  code: 'EBUSY',
  syscall: 'unlink',
  path: 'C:\\Users\\RAINBO~1\\AppData\\Local\\Temp\\firefox-profileHdw2uD\\cert9.db'
}

Full logs here err.log

What is the expected or desired behavior?

Firefox quits and the profile is deleted

Version information (for bug reports)

Rob--W commented 2 months ago

The error maybeScheduleBackgroundUpdateTask: exiting after uncaught exception in maybeScheduleBackgroundUpdateTask! is from Firefox itself, and was fixed in Firefox 127 by https://bugzilla.mozilla.org/show_bug.cgi?id=1891521

Are you still experiencing the same issue?

7003Mars commented 2 months ago

Unfortunately, the issues still occurs as of firefox 127.0b5 when run with web-ext run --no-reload --source-dir ./dist --firefox=beta -v err.log

7003Mars commented 2 months ago

Without the --no-reload flag, firefox also fails to quit on Ctrl-c Modifying exit() in firefox-desktop.js

    console.log(`Kill? ${this.runningInfo.firefox.kill()}`);

shows that kill() returned false.