File association/xdg-open



  • Hi,

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

    https://get.adobe.com/flashplayer/download/?installer=FP_24.0_for_Ubuntu_(apt)&stype=5496&standalone=1

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

    Screenshot

    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.
      0_1488951850886_023.jpg
    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)
    0_1488951304881_026.jpg

    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 https://get.adobe.com/flashplayer/otherversions/ and chose "Linux64" and "Ubuntu(apt)".
    When dialog came up chose...
    0_1488957021935_027.jpg

    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 (store.kde.org) 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 https://store.kde.org/p/998917/#files-panel, 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.
    0_1488962643240_028.jpg



  • @CantankRus

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

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

    0_1488972344566_upload-54a1bd34-1944-4c92-86d9-383ba86e0083



  • 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. :confused:


  • Vivaldi Translator

    @FinallyHomeAgain
    Per https://bugs.chromium.org/p/chromium/issues/detail?id=62799
    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 (https://forum.vivaldi.net/post/122022).
    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.

    Notes:
    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.
    0_1489024354961_030.jpg
    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.


Log in to reply
 

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