MacOS – Why does HTML mailto link open Brave browser

macosvisual-studio-code

I'm a web developer working on macOS "Big Sur". I've noticed recently that if I create a web page in Visual Studio Code that contains an HTML anchor tag with a "mailto" href attribute and I launch a local web server using the Live Server extension, if I click that link, my Brave browser opens up. What I would expect is that the Apple Mail application would open.

<body>
  <a href="mailto:smith@mac.com" id="email">smith@mac.com</a>
</body>

Is this a macOS problem or should I blame the Visual Studio Code extension?

Best Answer

mailto: links open in the system's default Email Reader. You might have this configured as Brave.

On macOS you change the default Email Reader from Preferences inside the Apple Mail app. See https://support.apple.com/en-us/HT201607

In Chrome, there is also a setting to determine which website (e.g. Gmail) handles the protocol, I assume Brave works similarly: https://support.google.com/a/users/answer/9308783?hl=en