emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: org-capture firefox extension broken [silently]


From: Max Nikulin
Subject: Re: org-capture firefox extension broken [silently]
Date: Sat, 11 Jun 2022 09:30:11 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1

On 11/06/2022 08:43, Samuel Wales wrote:
On 6/10/22, Max Nikulin wrote:
- Have you tried to check that org-protocol still works on your system?
        xdg-open 'org-protocol:/org-capture?url=something'

i ran this from emacs shell mode bash cli as user.  it brought firefox
to fg, opened a new tab, and the tab has a search page in my default
search engine that says "org-protocol:/org-capture?url=something" in
the search box.  is that correct?

First of all, I recommend to run such command in a terminal application instead of Emacs. I do not remember which of Emacs shell modes executes commands asynchronously (eshell?), so xdg-open fails e.g. for Gnome or KDE. Having fluxbox you should be affected in less degree. Another point is that when shell running emacsclient is associated with a terminal then emacs might try to create a frame inside this terminal. I am unsure concerning your preferences for capture windows, but it is better to factor out Emacs as shell here.

Actually you have found the source of the problem. A handler for org-protocol is not configured in your environment, so xdg-open falls back to a browser and firefox falls back to search engine. It is not a problem of the browser add-on.

Prevented navigation to 
“org-protocol://capture?template=p&url=https%3A%2F%2Fplanet.emacslife.com%2F&title=Planet%20Emacslife&body=This%20month”
 due to an unknown protocol.

"unknown protocol" confirms the conclusion.

Check that the ~/.config/mimeapps.list (or maybe ~/.local/share/applications/mimeapps.list) file contains the following sections and entries therein (unsure exact name of your desktop file)

[Added Associations]
x-scheme-handler/org-protocol=org-protocol.desktop;
[Default Applications]
x-scheme-handler/org-protocol=org-protocol.desktop;

Or ~/.local/share/applications/mimeinfo.cache has
[MIME Cache]
x-scheme-handler/org-protocol=org-protocol.desktop;

I just have realized that for kde-open5 it is enough to have mimeinfo.cache entry. Gnome without "Default Application" entry shows its own application selection dialogue. When there is no handlers like kde-open5 specific to desktop environment, xdg-open may scan .desktop files. It seems, you have some problem with your .desktop file for org-protocol. Check that you have it in ~/.local/share/applications/ and try the command specified in the Exec field in a terminal (with some org-protocol URI).

An entry in ~/.local/share/applications/mimeinfo.cache is usually created by
    update-desktop-database ~/.local/share/applications
and entries to ~/.config/mimeapps.list may be added by
    xdg-mime default org-protocol.desktop x-scheme-handler/org-protocol
or something like
xdg-settings set default-url-scheme-handler org-protocol org-protocol.desktop
The latter actually calls the former. To check that files are updated:
    xdg-mime query default x-scheme-handler/org-protocol
    xdg-settings get default-url-scheme-handler org-protocol

If it is still broken then it is time to inspect output of
    sh -x /usr/bin/xdg-open 'org-protocol:/org-capture?url=something'

- Have you tried to create a html page with an org-protocol link and to
click on it?

no clue what i would do to do that.

For example, create an org file with some link, export it as HTML, edit the result to use the URI from "Prevented navigation" error in <a href="..."> and open this html file in Firefox. Using org-protocol URI as link target in an org file is possible as well, but additional setup may be required to avoid treating it as unknown target.

By the way, https://github.com/sprig/org-capture-extension/ has some instructions. They are not perfect, but they are still in some points better than worg page for org-protocol.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]