3

I save links as files, rather the using bookmarks. I just drag the URL field from Firefox onto my desktop/folder.

Recently these stopped opening in Firefox, and started "opening" in Gedit. Even in Gedit, the file errors. The only way I can open these to even see the link is by using vim, having navigated to the file from the terminal.

There are a number of threads with similar problems, to solutions to which I have tried to no avail. <THIS THREAD> describes exactly my problem, but no solution is posted.

Example URL File Contents:

[Desktop Entry]
Encoding=UTF-8
Name=Link to Google
Type=Link
URL=http://www.google.com
Icon=text-html

Contents of my ~/.local/share/applications/mimeapps.list:

[Added Associations]
application/x-rpm=ubuntu-software-center.desktop;
x-scheme-handler/mailto=thunderbird.desktop;
message/rfc822=thunderbird.desktop;
application/x-extension-eml=thunderbird.desktop;
inode/directory=vlc.desktop;
application/pdf=inkscape.desktop;kde4-okularApplication_pdf.desktop;
text/x-python=vim.desktop;gedit.desktop;
application/pgp-keys=libreoffice-calc.desktop;
image/x-hdr=gedit.desktop;
text/plain=libreoffice-calc.desktop;
audio/x-vorbis+ogg=totem.desktop;
application/octet-stream=gedit.desktop;
x-scheme-handler/ftp=firefox.desktop;
x-scheme-handler/chrome=firefox.desktop;
text/html=firefox.desktop;
application/x-extension-htm=firefox.desktop;
application/x-extension-html=firefox.desktop;
application/x-extension-shtml=firefox.desktop;
application/xhtml+xml=firefox.desktop;
application/x-extension-xhtml=firefox.desktop;
application/x-extension-xht=firefox.desktop;

[Default Applications]
x-scheme-handler/mailto=thunderbird.desktop
message/rfc822=thunderbird.desktop
application/x-extension-eml=thunderbird.desktop
application/pdf=kde4-okularApplication_pdf.desktop
text/html=firefox.desktop
x-scheme-handler/http=firefox.desktop
x-scheme-handler/https=firefox.desktop
x-scheme-handler/about=chromium-browser.desktop
x-scheme-handler/unknown=chromium-browser.desktop
audio/x-vorbis+ogg=totem.desktop
x-scheme-handler/ftp=firefox.desktop
x-scheme-handler/chrome=firefox.desktop
application/x-extension-htm=firefox.desktop
application/x-extension-html=firefox.desktop
application/x-extension-shtml=firefox.desktop
application/xhtml+xml=firefox.desktop
application/x-extension-xhtml=firefox.desktop
application/x-extension-xht=firefox.desktop

And here is a screen-shot of Gedit trying to open these: Gedit trying to open these:

Any help super appreciated, as this is driving me crazy.

  • Post the link into the question. Someone else can add it as a picture ;) – Rinzwind Nov 20 '12 at 15:28
2

It appears I borked things when following <a tutorial> to set things up so I could just right-click files to open them in vim.

The two resources I found most helpful to figure this out were:

There was clearly nothing wrong with the url files, as navigating to their parent directory and running the following opened them in just fine:

# firefox url-name.desktop

This indicated that there was an issue with the Exec line for getting run properly. I then discovered that I had a symbolic link to my firefox.desktop file by running the following in my user specific directory:

# ls -l ~/.local/share/applications/

As described in the second link, mimeapps.list is a user-specific list of default applications to be used to open various mime-types (i.e. file types).

I renamed this file to archive it, and then I created a sym-link to the defaults.list:

# ln -s /local/share/applications/defaults.list/ ~/.local/share/applications/defaults.list

Restarting , and everything worked! Phew. Hopefully, this helps somebody. Now to see what I did wrong with that vim tutorial...

0

Don't know if that's the problem, but it looks like a wrong URL in your example:

URL=http://www.google.html

The top-level domain (.com, .de, …) is missing.

Maybe the gedit error could be a result of this, because of the /, if gedit might think that it's a local file path (instead of a Internet URL)? Doesn't seem plausible, though (why does gedit even bother? Shouldn't it simply show the text file content anyway?). Is gedit trying to navigate to the URL?

  • Thanks unor. I did a manual edit of a link to make it more generic, and missed this. I solved my question, but was required to wait to post the answer as a new member. – ryanjdillon Nov 21 '12 at 10:02
0

I just experienced the same problem in 16.04 where web links on my desktop was being opened on gedit instead of firefox with the error:

Could not open the file “https://...”. Unable to handle “http:” locations."' 

Error - Unable to handle “http:” locations.

I was able to fix the problem by editing:

~/.config/mimeapps.list

Find the entry:

application/octet-stream=gedit.desktop;

This entry will mostly likely under the [Added Associations] heading. Move this entry to under the [Removed Associations] heading. Save the mimeapps.list file and the behaviour should be fixed immediately.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.