Hacking Together a Native Version of Discord for M1 Macs

Final Update (Nov 24, 2021)

As of today, Nov 24, 2021, Discord Canary is fully native on Apple Silicon! Instead of using one of these methods I recommend using the Canary build instead. Presumably this will flow to the normal cannels soon.

Download Discord Canary here

Update (Nov 2, 2021)

As well as this method works, there’s actually a better method out there now for running Discord on your M1 (or M1 Pro/Max) Mac. GitHub user yannhodiesne has put together an all-in-one package of Discord for M1 that has it all: screen sharing, voice calls, notifications, you name it. I recommend downloading their compiled DMG version instead of building your own.

Check it out here: https://github.com/yannhodiesne/Discord-M1

Original Post

I love my M1 MacBook Air. It’s the fastest and quietest computer I’ve ever owned. Over the past few months I’ve transitioned to using it as my main machine for all of my work. Almost all of the apps I use on a daily basis have been transitioned already to work on the new architecture natively, and the ones that are left on Rosetta are working perfectly fine for the most part.

There’s one notable exception to that though: non-native Electron apps are garbage. They perform extremely slowly and drain the laptop’s fantastic battery much faster than they should. Slack and VSCode have already made the jump which leaves one remaining: Discord.

Discord has been quiet about their transition plans so far and hasn’t responded to anyone on Twitter to address their timeline for migration. I have to assume they’re working on it, but the lack of communication and clear timelines is disheartening.

The community has gotten increasingly annoyed by this as Discord continues to not address their migration strategy. Discord being an Electron app at heart though does present an interesting possibility: the ability to wrap it in Electron ourselves.

Enter nativefier. nativefier is an open-source tool that makes it easy to wrap any website in a basic Electron wrapper. With a one-line command it’s very easy to wrap Discord in a native app with almost all of the features of the official build.

Credit for this goes to Discord user Jesca. They provided a one-liner that turns Discord into a nicely wrapped Electron app in the forum discussion I linked earlier. I’ve modified it a bit to work better for my uses.

Before you run this, you’ll want to install nativefier using npm install -g nativefier and download a Discord app icon from macOS Big Sur Icons. Name the file discord.icns.

Once you have the icon file in the directory you’re running in, run this command:

nativefier https://discord.com/app --enable-es3-apis --icon discord.icns --browserwindow-options '{ "fullscreenable": "true", "simpleFullscreen": "false" }' --darwin-dark-mode-support --background-color #36393f

What you’ll get is a native Electron-powered version of the Discord app. Notifications, audio, and video all seem to work. I’m super happy with the results here. This will definitely hold me over until Discord gets their act together and publishes a truly native build of their app for M1.

Update (2021-03-31)

A reader wrote in with an additional userdata script that you can inject into the Electron app to make it look and feel more like the normal version of Discord for macOS.

Create a file called discord-platform-osx.js in your working directory with these contents:

Then, run this nativifier script instead of the one above:

Using this userdata script and new arguments will give you a Discord window that has the hidden titlebar just like the “real” version. It works like a charm!

Arthur Rosa is an engineering manager based in Sunnyvale, California.