File association/xdg-open

  • Hi,

    I just ran into a problem while trying to download the PPAPI Flash from Adobe's website:

    When opening this link, the following dialog window popped up:


    I clicked "Don't open", assuming I would be offered a "Save as..." dialog instead. I also ticked the "Remember my choice" part. However, no "Save as..." dialog popped up, and now I can't even get that one back.

    I there a way to unremember this choice?
    Also: Is there a way to make Vivaldi give me a save dialog instead? "Ask me where to save each file before downloading" doesn't seem to do the trick. Otherwise I'll have to use a different browser to download this file.

    Another thing I noticed is that sometimes Vivaldi offers me files to download that it could handle itself, even though there shouldn't be any content disposition header in place. These files are probably sent without or with the wrong mime type. This leaves me with the choice of downloading the file (e.g. a PNG) or pressing open and waiting for GIMP to start launching. It would be very nice if there was a way to convince Vivaldi to try opening the file (at worst giving showing me plain text). This obviously isn't very important though.

  • Sounds like the file associations are somehow messed up in your operating system. I did some testing and Vivaldi seems to display some images correctly whether or not they are served with the right media type header, unlike Firefox.

    Xdg-open is used to determine which program to open a file with. I assume you can turn it back on in some graphical settings manager on your OS.

  • Chromium based browsers keep a record of file protocols in the "Local State" file.
    I am on Ubuntu 16.04 so instructions are OS specific. Adjust if necessary for your Distro or if using vivaldi-snapshot.

    1. Close Vivaldi
    2. Open with your text editor
      gedit "/$HOME/.config/vivaldi/Local State"
    3. Search for protocol_handler and remove the section "apt":true, including the trailing comma.
    4. Save and close

    Should now get the xdg-open dialog box.

    If you're on Ubuntu, just a note on what's happening here.
    AptUrl takes a URL which follows the apt-protocol as a command line option,
    parses it and carries out the operations that the URL describes.
    When you download flash from adobe using the apt link, all it is doing is enabling Ubuntu's partner repository and installing the adobe-flashplugin package using your package management system.

    You can accomplish the same by going to
    "software and updates" > other software
    and enabling the Canonical Partners repository. (Should be listed but not enabled by default)

    Then update sources.
    sudo apt update
    and install flash.
    sudo apt install adobe-flashplugin
    This installs both npapi and ppapi flash plugins.

  • This seems to be an issue with Chromium. After Googling for a bit, people on various threads suggest doing this:

    1. Close Vivaldi.
    2. Navigate to ~/.config/vivaldi or ~/.config/vivaldi-snapshot
    3. Open Local State
    4. Find the line containing protocol_handlers and delete it.
    5. Restart Vivaldi.

    But I can't seem to find that line in Local State, so I don't know what to do here. I installed Chrome to see if those steps worked for it and I ran into the same problem. Interestingly, doing this did work for Chromium. But that doesn't change the fact it doesn't work in Vivaldi or in Chrome.

    The most recent information I could find about this anywhere was this thread on Reddit, where a user was apparently having a similar issue to the one you're having here. That thread is 3 years old.

    Like kumiponi said, xdg is used by the system to figure out how to handle file protocols. In this case, Adobe has their site set up so that when a user tries to download flash for Ubuntu, apt gets launched. Here's what you see if you inspect the button: apt:adobe-flashplugin?channel=$distro-partner Basically, xdg is the middle man between Vivaldi and apt.

    Is there any reason you can't just install pepper flash from Ubuntu's repos?

    apt install pepperflashplugin-nonfree

  • @Tiamarth said in File association/xdg-open:

    Find the line containing protocol_handlers and delete it.

    You look like your searching for plural (no "s") and don't delete the line because the file is just one long line.

    Is there any reason you can't just install pepper flash from Ubuntu's repos?
    apt install pepperflashplugin-nonfree

    Since adobe is supporting Linux again the package to install is adobe-flashplugin from the partner repository.

  • @CantankRus I was just quoting the steps verbatim from someone else who had posted elsewhere years ago, only changing "Chrome" to "Vivaldi" where necessary.

    Adjusting to singular as you suggest is still useless, for me, as it returns no matches. Screenshot

  • @Tiamarth said in File association/xdg-open:

    @CantankRus I was just quoting the steps verbatim from someone else who had posted elsewhere years ago, only changing "Chrome" to "Vivaldi" where necessary.

    Adjusting to singular as you suggest is still useless, for me, as it returns no matches. Screenshot

    The setting is for "excluded_schemes" so you possibly don't see it till you exclude a protocol.
    I only tested here after doing what @FinallyHomeAgain did in his first post, which was marking the "Remember my choice for xdg-open links".

  • @CantankRus

    I only tested here after doing what FinallyHomeAgain did in his first post, which was marking the "Remember my choice for xdg-open links".

    I did this before posting, too. I did not then, and still do not see protocol_handler in Local State. I also don't see it in ~/.config/google-chrome/Local State after excluding xdg-open links in Chrome. I do see it in ~/.config/chromium/Local State after excluding it in Chromium, though. Like I said in my first reply.

  • @Tiamarth
    I just tested again.

    Ran vivaldi from a fresh profile. (this creates the folder vivaldi-test-profile in your home folder which can be deleted after testing)
    vivaldi --user-data-dir=vivaldi-test-profile

    Closed vivaldi and opened the local state file.
    gedit "/$HOME/vivaldi-test-profile/Local State"
    Searched for protocol ...not present. Close file.

    Opened vivaldi again using test profile.
    vivaldi --user-data-dir=vivaldi-test-profile
    Went to and chose "Linux64" and "Ubuntu(apt)".
    When dialog came up chose...

    Closed Vivaldi and opened local state file again.
    gedit "/$HOME/vivaldi-test-profile/Local State"
    Search term protocol is present.
    So the only explanation I have is you're doing something different.

  • @CantankRus

    So the only explanation I have is your doing something different.

    I did, very slightly. I'm on Manjaro, so I can't test an xdg link that tries to open apt. Instead, I went to a site ( I know to have an abundance of xdg links and tested using one of them. But other than that, I did exactly the same. Here's a short video to show exactly what I did.

  • @Tiamarth
    See exactly the same behaviour as with apt-url, after installing ocs-url which that site uses.
    Went to, clicked install and denied and remembered choice for xdg-open as before.
    Searching for protocol in the "Local State" file, now shows "ocs":true, instead of "apt":true, in the excluded_schemes section.

  • @CantankRus

    Searching for protocol in the "Local State" file, now shows "ocs":true

    "ocs" does not appear in my Local State file either.


  • Apparently, fixing this issue is underway at the Chromium project.

    I tried to reproduce @CantankRus's method with OCS and that entry got added to Local State immediately. Thanks for the insight. Maybe @Tiamarth's excluded_schemes are stored somewhere else for some reason. 😕

  • @FinallyHomeAgain
    The external protocol_handler had been moved to Preferences file just recently.

    It's a PITA to edit that wrapped file as it big & obvious error prone. I recommend using a JSON editor or at least use tools like aeson-pretty to prettified JSON file first.

    I re-step what you've done & fix it almost like @CantankRus steps above in (
    But not just deleting apt line, it won't work. I deleted all that protocol_handler register then xdg-open box will be back. Vivaldi or Chromium/Chrome will re-add the default lines latter.
    Backup your Preferences file before hand.

    There's a bunch of JSON editors extensions/apps for Chrome & Firefox. Just edit another copy of Preferences file if you use Chrome extension in Vivaldi.
    Of course, if you happen to be a Vim user, you know what to do with "%" key.

  • Using a json editor is a good idea.
    I installed JSON Editor app in google-chrome.
    Backup your "Local State" file.
    You can then drag and drop "Local State" into the left pane of app.
    Search in right pane for apt and you can untick or click on the box to left and delete.
    If you untick you won't see the xdg-open confirmation but will continue to apt to install.
    If you remove, you will see the xdg-open confirmation again.
    The file is saved to Downloads as a .json file.
    Rename without the extension and replace your original file.

    @Tiamarth, as @dleon indicated, the file to edit in vivaldi-snapshot is ~/.config/vivaldi-snapshot/Default/Preferences and recommend using a json editor.
    I tested and works.

  • @dLeon , @CantankRus Thank you both, you're right. The setting was in Preferences, and this has resolved my issue.

  • Hi there,

    althought this topic is old, I'm having exactly the same problem using Vivaldi Snapshot version 1.13.971.8 on Kubuntu 16.04, kernel version

    Although I installed apturl correctly, I still can't open any links starting with apt:// in my default browser Vivaldi.
    In Firefox, Chrome, Opera and Opera Developer doing so works like a charm!

    I hadn't any luck following the above instructions:
    In ~/.config/vivaldi-snapshot/Default/Preferences there was no apt - entry at all.
    When I tried to add "apt":false, manually via an editor to be at least able to untick it, I got an error with the profile and Vivaldi didn't want to start at all.

    @Tiamarth, as @dleon indicated, the file to edit in vivaldi-snapshot is

    Checking the command cat /usr/bin/apturl results:
    if [ "$KDE_FULL_SESSION" = "true" ] && [ -x /usr/bin/apturl-kde ]; then
    apturl-kde $@
    elif [ -x /usr/bin/apturl-gtk ]; then
    apturl-gtk $@
    elif [ -x /usr/bin/apturl-kde ]; then
    apturl-kde $@
    echo "Please install apturl-gtk or apturl-kde."

    I even tried xdg-mime default apturl.desktop x-scheme-handler/apt. Aparently without success, although you can find the entry in ~/.local/share/applications/mimeapps.list.

    I even created a apturl.desktop:
    [Desktop Entry]
    Exec=/usr/bin/apturl %u
    Comment=APT‑URL handler

    If I click on any install now - button / link in the ubuntuusers Wiki, the following message pops up: xdg-open open?

    If I agree by click on xdg open, I am getting an error:
    KIO-Client – Error
    Unknown computer apt: Computer couldn't be found

    I appreciate any idea which can help me to resolve this issue!

    Thank you in advance about your timely responses!



Looks like your connection to Vivaldi Forum was lost, please wait while we try to reconnect.