0

I got Uncaught (in promise) AbortError: The user aborted a request. error after clicking on my popup button, and selecting a folder on my computer

Popup.js

document.addEventListener('DOMContentLoaded', function() {

    document.getElementById('btnCreate').addEventListener('click', async function() {

      // Request permission to write to the file system
      const handle = await window.showDirectoryPicker();

      // Create a new directory inside the selected directory
      await handle.getDirectoryHandle('myFolder', { create: true });

  });  //<--- This is the line which my chrome debugger shows which (probably) problem happens and I don't know why
})
EML
  • 9,619
  • 6
  • 46
  • 78
Milad
  • 77
  • 11

1 Answers1

0

This is a bug; showDirectoryPicker doesn't work in extensions. See here, here, etc. It doesn't look like a fix is imminent.

EML
  • 9,619
  • 6
  • 46
  • 78