Brave Won't Open Discord Invites in Discord App

One of the filterlists blocks websocket connections to 127.0.0.1 which is necessary to communicate with the discord app I believe. If I add @@||127.0.0.1^$domain=discord.com to the custom filters to whitelist it and the discord app is running in the background, it works, and the invitation shows up in the app.

Can you screenshot the devtools/network tab showing localhost requests @ghu

Sure. This shows 10 connection errors and retries:


After whitelisting 127.0.0.1 it connects on the first try, sends the invitation message, and the invitation shows up in the Discord app:


I should probably mention I’m on Linux so my case could differ from Windows users’.

The invite opened here, had to re-sign in first. But worked

Your brave shield looks disabled on your screenshot.

Yeah, Was testing with and without.

@AgentCPU0 @Saoiray

Can you please test the solution I proposed above? Click on the shield icon, click Filter lists there, it will bring up the content filters settings page, enable Developer mode, and put the following line in the Create custom filters textbox:

@@||127.0.0.1^$websocket,domain=discord.com

Finally hit Save changes.

Make sure Discord is already running in the background. Visit an invitation link and see if it works.


@fanboynz

It seems there are a group of people for whom it is broken with shield on and works with shields disabled, and another group of people who gets a discord handle under the right condition and the shields make no difference. It could be a “feature” which got rolled out in only some regions. I’m in EU. I tested this, and I don’t get the discord handle in Chromium nor in Firefox, both of them try to communicate with the app via websockets (which is blocked by brave).

Digging deeper in the javascript code, it is in line with what I said. The mount code of the invitation page looks like this:

if (!supportsWebsockets()) {
    // use "discord://" handle to open discord with invitation link
} else {
   // use websockets to send invitation link
}

where supportsWebsockets is this:

if (null == window.WebSocket)
    return false;
switch (o().name) {
    case "IE":
    case "Microsoft Edge":
        return version >= 15;
    default:
        return true
}

Although if I set window.WebSocket to undefined the website breaks, if I set my user agent to an older Edge version, the discord handle pops up.

I can see there are already a couple of similar exceptions in brave-specific.txt. How can I help to get this fixed?