I don't have enough reputation to put this in a comment, so I'm just going to write out a whole new answer in order to include Firefox, especially since it will allow Tor users to run off a local node).
As pointed out above, the
--rpccorsdomain flag needs to be enabled. Each browser has a different extension that you'll need to put in, though.
For Chrome (as detailed on MetaMask's docs here):
geth --rpc --rpccorsdomain="chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn"
I got two different outputs on two different computers for the
moz-extension for MetaMask's Firefox extension. (Tor is built on Firefox, and as such, Tor users should follow the same process.) A such, I'll link to this StackOverflow question which can tell you how to find the ID on your machine (ignore the last backslash). (Make sure MetaMask is active, as to say not disabled, when you run the memory test.) Your geth command should look something like:
geth --rpc --rpccorsdomain="moz-extension://f3a66ea7-df4d-4731-80db-de45a4abebd6"
I can confirm that I have connected a local node to MetaMask on Firefox using this method.
I suspect Brave is using the Chrome extension (especially since it's the example on their site here, and can therefore use the same code as for Chrome above, but have not confirmed this.
Opera and Edge
I have no knowledge as to how to connect on Opera or Edge, but am happy to update if anyone else does.