Earlier quoted context omitted.
There is such API. https://developer.mozilla.org/en-US/docs/Web/API/File_System...
Still requires drag&drop on most browsers because the File/DirectoryPicker API isn't universally supported.
And in any case it's easier to direct users to install Chrome (or preferably Chromium) or instruct drag&drop than doing the brittle and error and bitrot prone virtualenv-pip-docker-git song and dance.