how to get microphone permission when button is clicked in extension popup

navigator.mediaDevices.getUserMedia({
                                audio: {
                                    echoCancellation: !0,
                                    channelCount: 1,
                                    sampleRate: {
                                        ideal: e
                                    },
                                    sampleSize: i
                                }
                            })

it return promise value Rejected and promise status DOM:Shutdown