arkenfox / user.js

Firefox privacy, security and anti-tracking: a comprehensive user.js template for configuration and hardening
MIT License
10k stars 512 forks source link

Video blocked on discord.com [solved: RFP spoofs FF version = discord says ESR78 not supported] #1119

Closed bakgwei closed 3 years ago

bakgwei commented 3 years ago

I am struggling with getting video to work on discord.com. After lots of trial & error I have managed to get audio to work by changing the following two settings: user_pref("dom.webaudio.enabled", true); user_pref("media.peerconnection.enabled", true);

However, I have tried forever changing every possible other media setting to get video to work, but to no avail. Any help would be much appreciated.

Thorin-Oakenpants commented 3 years ago

There have been numerous reports in the past of discord video/audio not working

Does video/audio work fine in a new profile? What is your Firefox version? Have you looked at the override recipes: which includes getting WebRTC to work see #1080 What is the error? Is it in the console? Is it on the screen? What happens? A never ending loading icon, or a message on the web page?

bakgwei commented 3 years ago

Thanks for the quick reply. I did see this other thread - and yes, I did go through the sticky override thread before posting here (https://github.com/arkenfox/user.js/issues/1080). None of the tips worked.

It does work in a new profile (and also in Chrome for instance), so I think I have narrowed it down to the user.js

Audio works fine on discord, but when clicking in the video button I get the message "video not supported in your browser, please download our desktop akk Screenshot 2021-02-17 184331 " - see screenshot.. I am on the latest FF version, 85.0.2

bakgwei commented 3 years ago

Just to clarify further: I can see incoming video - just my own "camera" is blocked by user.js

Thorin-Oakenpants commented 3 years ago

Did you get any prompts to allow the camera?

Thorin-Oakenpants commented 3 years ago

oh wait a second, try setting this one to true (I'm guessing here)

/* 2505: disable media device enumeration [FF29+]
 * [NOTE] media.peerconnection.enabled should also be set to false (see 2001)
 * [1] https://wiki.mozilla.org/Media/getUserMedia
 * [2] https://developer.mozilla.org/docs/Web/API/MediaDevices/enumerateDevices ***/
user_pref("media.navigator.enabled", false);
bakgwei commented 3 years ago

No, it never gets that far. For audio I did get the prompt (after I changed the two settings I mentioned in my original post).

bakgwei commented 3 years ago

media.navigator.enabled

Nope, no joy either :-(

Thorin-Oakenpants commented 3 years ago

also see #1116 (might be something in there) .. might pay to clear cache etc, maybe restart between tries

Thorin-Oakenpants commented 3 years ago

is anything blocked in the blue ETP shield: like a cross-domain cookies. Sounds like the connection is blocked: maybe it's FPI (4501)

edit: I have to scoot: you can always try a binary approach of a new profile, add half the user.js and test .. then add the next quarter... etc ...

or in a new profile only add the section or part section you think breaks it. if it works, add the next 20 prefs, etc

bakgwei commented 3 years ago

OK, thanks. I will have a look at the two links you posted. And I appreciate your help - yes, I could go through the steps you described. But somehow I am thinking I am not the only one having this issue.

So lets give it a rest for now - hopefully someone else will stumble across this thread who has found a solution. Discord is a very popular site, so I am hopeful I dont have to start the time consuming trial-and-error approach.

bakgwei commented 3 years ago

Just to report back: The issue seemed to have been the following: user_pref("privacy.resistFingerprinting", false);

With this set to false (default value is true) the video is available. However, I dont get the prompt if Firefox can use my camera. Any idea as to why? Its not blocked in the settings, so the prompt should come (it does on other websites).

Thorin-Oakenpants commented 3 years ago

Thanks for your troubleshooting @bakgwei, much appreciated. A couple of things...

Can you confirm in a new profile, that only changing privacy.resistFingerprinting (RFP) to true blocks the video: i.e in this case you do not get a prompt to allow the camera

As for why discord behaves differently could be a number of things: I've seen other bugs with RFP which were caused by timing protections causing the script to abort. The only thing to do here is to kick this upstream and investigate: I assume discord requires an account (I don't have one)?

Meanwhile, up to you, but disabling RFP removes a lot of fingerprinting protection should a script get through and run. You could use a secondary more relaxed profile or a browser for problem sites. Up to you: usability vs some protections

Edit: side-note: fingerprinting scripts are becoming embedded inside other js files required for site functionality: so FP script blocklists are becoming less effective

Thorin-Oakenpants commented 3 years ago

^ bump @bakgwei :)

bakgwei commented 3 years ago

Sorry for the late reply, was away for a day. I tried in a new profile as you suggested, and yes, I get the video prompt there.

Also, thanks for the info about RFP. If I somehow manage to get Firefox to access my camera in Discord I will leave it on as a standard and only switch if off during the video call. For now I am switching over to Chrome for Discord. Kind of annoying, but thats the way it is.

Thorin-Oakenpants commented 3 years ago

I tried in a new profile as you suggested, and yes, I get the video prompt there

Umm... "Can you confirm in a new profile, that only changing privacy.resistFingerprinting (RFP) to true blocks the video: i.e in this case you do not get a prompt to allow the camera"

So in your new profile, did you change RFP? Because I want to confirm that it is RFP causing the problem and nothing else. Then I can kick it upstream to Mozilla. Your reply is not clear and indicates that RFP is not the problem

bakgwei commented 3 years ago

OK, gotcha, I misunderstood your question. Here is what happens:

With a fresh profile, on the discord page: Audio: When I click to talk with someone I get the microphone prompt, all good. Video: The same with video, works after I allow the use of my camera.

After deleting the two allowances (ie resetting access to mic and camera) and changing the setting privacy.resistFingerprinting to true: Audio: Works exactly as above after I get the prompt to allow access to microphone. Video: The video button is greyed out, clicking on it gives the error message that video is not supported in this browser.

Thorin-Oakenpants commented 3 years ago

Alright. I actually dig some more digging (but don't have an account to test it).

this reddit post from a month ago indicates it is the user agent version that causes it

and now your last comment seems to confirm that: discord thinks you are on ESR78. One way to test that (not saying you need to) is to use a new profile in ESR78 and you should get the same video failing to work

Thorin-Oakenpants commented 3 years ago

There are only a few solutions to this while still using RFP

I'll close this and add a note to the override recipe.

@bakgwei Thanks for your detective work 💋 🍻 🍰

rusty-snake commented 3 years ago

FWIW: User-Agent Switcher (source) supports default unchanged and per domain change. It's my favourite extension to unbreak sites based on UA overrides. It's from the same author as smart referer and spoofs other properties of the navigator object too (though there is a bug https://gitlab.com/ntninja/user-agent-switcher/-/issues/76).

Thorin-Oakenpants commented 3 years ago

wait .. so User-Agent Switcher gave out (and still does?) very unusual results (for linux?)? doesn't inspire me TBH, but of course bugs happen, and if used the way I said, it's not a big deal

I was considering adding it to the extensions maybe list, adding a note to use it as default=unchanged and per-domain=spoof for problematic sites with RFP: but I don't think too many sites break because of RFP versioning TBH (I do not see this on bugzilla). That said, sites do have compat issues with Firefox (even without RFP), so if maybe it's best that we recommend one that has a default=unchanged setting

@rusty-snake Speak now or forever hold my beer - should I add it? yes/no?

rusty-snake commented 3 years ago

for linux?

The window fakes have navigator.platform = "Win32", but IDK the windows default value.

should I add it? yes/no?

The advantage of adding it as a "If you ever need to spoof your UA to unbreak a site, use User-Agent Switcher" is that folks don't use any unknown extension (and there are dozens).

Thorin-Oakenpants commented 3 years ago

IDK the windows default value.

it's always Win32

Thorin-Oakenpants commented 1 year ago

RFP no longer spoofs version on desktop FF102+