Imported JS running as a html needs access to the microphone, how do I grant it?

Does the JavaScript actually need to be in an HTML file?