Give Firefox permanent access to microphone on localhost

Solution 1:

As far as I know, you can't. The exact reason for the block is called getUserMedia.reasonForNoPermanentAllow.insecure. So unless you can tweak/spoof that somehow the only option would be to re-compile firefox from source.

The code you would need you change resides here.

// Don't offer "always remember" action in PB mode.
if (!PrivateBrowsingUtils.isBrowserPrivate(aBrowser)) {

  // Disable the permanent 'Allow' action if the connection isn't secure, or for
  // screen/audio sharing (because we can't guess which window the user wants to
  // share without prompting).

  let reasonForNoPermanentAllow = "";
  if (sharingScreen) {
    reasonForNoPermanentAllow = "getUserMedia.reasonForNoPermanentAllow.screen3";
  } else if (sharingAudio) {
    reasonForNoPermanentAllow = "getUserMedia.reasonForNoPermanentAllow.audio";
  } else if (!aRequest.secure) {
    reasonForNoPermanentAllow = "getUserMedia.reasonForNoPermanentAllow.insecure";
  }

  options.checkbox = {
    label: stringBundle.getString("getUserMedia.remember"),
    checkedState: reasonForNoPermanentAllow ? {
      disableMainAction: true,
      warningLabel: stringBundle.getFormattedString(reasonForNoPermanentAllow,
                                                    [productName])
    } : undefined,
  };
}

Solution 2:

Yes, this is sort of possible as explained in another answer to a related question.

Steps

  • Go to about:config
  • Set media.navigator.permission.disabled to true

However, this allows any website to access the camera and microphone without a prompt