google chrome. linux. XDG-OPEN keep asking me (forever) what to do with magnet links

16,585

Solution 1

This solution works for me on Google Chrome 84.0.4147.89, for specific types of xdg links. For example, if the link in question is magnet://someurl, you can use:

sudo mkdir -p /etc/opt/chrome/policies/managed/ && echo '{ "URLWhitelist": ["magnet://*"] }' |sudo tee /etc/opt/chrome/policies/managed/whitelist.json

Solution 2

it was a bug in chrome:
https://bugs.chromium.org/p/chromium/issues/detail?id=788431
fixed now on latest chrome beta (maybe on stable also).

Share:
16,585
Azriel
Author by

Azriel

Updated on September 18, 2022

Comments

  • Azriel
    Azriel almost 2 years

    (i'm on latest chrome beta (64) but it is happening in all the previous version of chrome i used.)

    when i press magnet links in google chrome, i get this card: Open xdg-open?

    so i mark to always open these types of links... and then press open xdg-open. now qBittorrent is starting to work. everything is OK.

    but, if i press another magnet link, it again pop up this card and ask me what to do. it always do that and never save what i choose for later.

    i have qbittorrent.desktop in /usr/share/applications

    the beginning of qbittorrent.desktop is:

    [Desktop Entry]                                           
    Categories=Network;FileTransfer;P2P;Qt;                   
    Exec=qbittorrent %U                                       
    GenericName=BitTorrent client                             
    Comment=Download and share files over BitTorrent          
    Icon=qbittorrent                                          
    MimeType=application/x-bittorrent;x-scheme-handler/magnet;
    Name=qBittorrent                                          
    Terminal=false                                            
    Type=Application                                          
    StartupNotify=false                                       
    StartupWMClass=qbittorrent                                
    Keywords=bittorrent;torrent;magnet;download;p2p;          
    

    also in ~/.config/mimeapps.list i have this:

    [Default Applications]                             
    text/html=google-chrome-beta.desktop               
    x-scheme-handler/http=google-chrome-beta.desktop   
    x-scheme-handler/https=google-chrome-beta.desktop  
    x-scheme-handler/about=google-chrome-beta.desktop  
    x-scheme-handler/unknown=google-chrome-beta.desktop
    x-scheme-handler/magnet=qbittorrent.desktop        
    

    if i command xdg-mime query default x-scheme-handler/magnet i get qbittorrent.desktop result.

    also if i command: xdg-mime default qbittorrent.desktop x-scheme-handler/magnet nothing is changed and problem exist.

    last thing, if i open terminal and command:

    xdg-open magnet:?xt=magnet-link-continue-here it opens qbittorrent with the link without a problem.

  • CPBL
    CPBL over 4 years
    Broken again? This bug and its numerous duplicates suggests so: bugs.launchpad.net/snapd/+bug/1776873 Certainly under Ubuntu 19.10 I can't open anything from the browser anymore.
  • ARNAB
    ARNAB over 4 years
    keeps prompting on debian testing tool frustrating.
  • Alfredo Diaz
    Alfredo Diaz over 4 years
  • jetole
    jetole about 4 years
    @AlfredoDiaz This didn't work for me. Chrome 81.0.4044.92 on Ubuntu 19.10. Still cannit select auto open / always open, etc and need to manually click it each time.