2

Problem:

I'm developing a webpage that uses the microphone to generate animations. I understand that FireFox needs to ask the user for mic access permission due to privacy concerns. However, hitting "Allow" every time I refresh the page, as a developer, gets really tedious.

First attempt:

I see there's an option to "Remember this decision", but it doesn't let me use this, because my content is being served via localhost, and not through a secure (https) connection:

enter image description here

Your connection to this site is not secure. To protect you, Firefox will only allow access for this session.

Second Attempt:

I tried adding localhost to the list of allowed websites under Settings, and still the problem persists:

enter image description here

Question:

Is there any way to override this security feature? I understand that this is a great feature to protect users from malicious websites, but this is localhost, and only for me to look at.

2 Answers 2

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,
  };
}
3
  • Aw, man. I was hoping there could be an easy override in about:config.
    – M -
    Commented Jul 30, 2018 at 20:21
  • I think I found a way. It works on my FF with an insecure site in the LAN. Open your website, then hit the page info button (left to the URL bar), hit the arrow next to the "Connection is not secure" and then go to "More information". On the top of that pop-up, go to "permissions", scroll down and untick "Use default" for the Microphone, then select "Allow" on the right. Does that work for you? If it does I'll update my answer.
    – confetti
    Commented Jul 30, 2018 at 20:26
  • Sadly, this also does not work. This is how I added localhost to the list of allowed sites in Preferences seen here: i.sstatic.net/MEb1i.jpg but it still asks for permission every reload.
    – M -
    Commented Jul 30, 2018 at 20:32
1

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .