brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.05k stars 2.23k forks source link

[Desktop] Provide option to "always" open files with system default or provide "do not ask again" option #6291

Open Brave-Matt opened 4 years ago

Brave-Matt commented 4 years ago

Description

As it is now, users can disable Webtorrent in settings and after doing this, the browser will prompt the user after clicking/downloading on a magnet link or torrent file, asking whether or not you'd like to use [System default torrent client] to open the file.

image

However, with this method, users are prompted every time they attempt to download a torrent/magnet file. This can be cumbersome and there should be a way to tell the browser to always default to the users preferred torrent client.

Consideration and Suggestion When adding this feature, there should also be a way to reverse the decision so that users can choose different clients if necessary.

I would suggest adding a couple checkboxes to the UI for the simplest implementation (plz excuse the hasty shop job): ask

And in Settings --> Extensions: wt

cc @yrliou @rebron

benesjan commented 1 year ago

Why has this not been solved yet without having to hack around? Who wants to use shitty web apps when you have fast native ones which are actually integrated with the OS?

kj4ezj commented 1 year ago

+1

I have a unique use case for which I have yet to find a workaround.

Problem

I have to use Zoom video conferencing on my personal computer (Linux Mint) for work, school, and sometimes even family. Zoom has shown the world that it is not safe to run their native client on your computer[1, 2, 3, 4] because of negligence or malice, so I use it exclusively in a web browser. Video conferencing tends to "just work" in Chromium-family browsers, so I use Brave for Zoom.

When you open a meeting link, it tries to invoke their native app whether you have it or not.

2022-10-11 18-21-51 - Brave Zoom prompt with missing link

You may notice the Join from Your Browser link is missing. This doesn't always happen, but it usually does. So, once I click Cancel on the Open xdg-open prompt from Brave, I have to click Launch Meeting, and deal with the prompt again!

2022-10-11 18-22-32 - Brave Zoom second prompt

Once Zoom has prompted my browser twice, it will always show the Join from Your Browser option.

As upset as your community members are for having to deal with this prompt once multiple times every single day, imagine how excited I am to have to deal with it TWICE multiple times every singe day. :)

Solution What I Tried

I spent a few hours on this, read a bunch, and tried a number of things. Ultimately I found this Stack Overflow answer, this article for macOS that gave me the protocol URI Zoom uses, and this Stack Exchange answer @aspiers shared earlier in this thread which pointed me in the right direction to figure out where these policies live on Linux these days, because they have moved around.

The closest I got to a working solution was this.

sudo mkdir -p /etc/brave/policies/managed
jq -n '.URLBlocklist=["zoommtg:*","zoommtg://*"]' | sudo tee /etc/brave/policies/managed/blocklist.json

I also threw in the policy to force the "Always allow" checkbox to appear, even though Zoom already has it, for good measure.

sudo mkdir -p /etc/brave/policies/managed
jq -n '.ExternalProtocolDialogShowAlwaysOpenCheckbox=true' | sudo tee /etc/brave/policies/managed/protocol_open.json

These policies were picked up by Brave!

2022-10-11 18-23-32 - Brave Zoom policies

Unfortunately, instead of blocking the Zoom website from invoking the xdg-open dialogue box for zoommtg://* URIs and letting me use the browser, it prevented the page from loading entirely.

2022-10-11 18-23-57 - Brave Zoom blocked

I guess the prompts are technically gone, but this did not solve my problem so I reverted the blocklist.

System

System

Kernel: 5.4.0-126-generic x86_64 bits: 64 compiler: gcc v: 9.4.0 
Desktop: Cinnamon 5.2.7 wm: muffin dm: LightDM Distro: Linux Mint 20.3 Una 
base: Ubuntu 20.04 focal

Brave

Version 1.44.108 Chromium 106.0.5249.103 (Official Build) (64-bit)

Please add some mechanism to block specific sites from invoking this pop-up, or automatically deny it. If you read the original issue, OP asked for two things (admittedly with an "or") and there is a workaround for some use-cases to accomplish one of them, but a lot of people asking for the other with no workarounds I could find. I don't care if it is a checkbox, button, policy, flag, or a seance I conduct by putting candles and salt in a pattern around my computer under a full moon...but we need something.

I am not able to PR a fix myself without a ton of hand-holding, but I can help test solutions and open to other ideas from the community. Thank you for your time and product, I'll be a Brave user five years this December!

asheroto commented 8 months ago

Possible duplicate of:

16927

26058