Max Nikulin <maniku...@gmail.com> writes:

> On 09/06/2025 21:13, Christian Moe wrote:
>> Charles Choi writes:
>>> -  : emacsclient org-protocol:/store-link:/URL/TITLE
>> This still works, though with a warning to "update your Org Protocol
>> handler to deal with new-style links".
> [...]
>>> -  : 
>>> javascript:location.href='org-protocol://store-link://'+encodeURIComponent(location.href)
>> Would think the old-style links would still be supported in the
>> browser too, but I can't get them to work.
> [...]
>>> -  : emacsclient org-protocol:/capture:/URL/TITLE/BODY
>> This works too, but the bookmark after doesn't.
>
> I have added "URL format" to the subject.
>
> First of all, I think, old-style URLs should be mentioned in the new
> "History" section. They should not be recommended to new users, but
> those, who are upgrading old config, should have a chance to notice
> this format as the obsolete one.

That makes sense (and given that Org gives a warning, it should probably
be treated as obsolete, although one *might* see it just as a simpler
and more compact alternative to query-style URLs). So Charlie can ignore
my objection to the deletion, and we can put it in a history section.

> Christian, what is your OS and Desktop environment if it is Linux?

Mint and xfce. The browser is Firefox.

> What if you use single or triple slash after org-protocol?

> javascript:location.href='org-protocol:/store-link:/'+encodeURIComponent(location.href)+'/'+encodeURIComponent(document.title);void(0)

You're right! (I thought I had tested this several times already, but I
must have done something else wrong.) Single slash does work, and so
does triple slash, quadruple slash, etc. Only double slash after
org-protocol fails.

The number of slashes between subprotocol (store-link:) and query
doesn't matter.

If single slashes work on all other platforms, we can use that.

> Are there messages in browser developer tools console (F12).

Not that I can see.

> My guess is that system handler tries to normalize invalid URL having
> no port number between host name with colon "store-link:" and path
> "/...".

Aha. That seems to fit with the facts, yes. Thanks for following up on
this.

Yours,
Christian

Reply via email to