mojira.dev
MC-253762

Using certain percent-encoded characters in open_url action of click_event does not open browser

When including certain percent-encoded characters in the open_url url, the browser does not open, and no errors show up. The loading circle appears very briefly next to the mouse, as if something should have happened.

When running a command like

/tellraw @s [{"text":"%2F '/'","color":"yellow","click_event": {"action":"open_url","url": "https://abc%2F"}}]

and clicking the text, the browser does not open. This of course happens without 'abc' as well.

When the command includes a percent-encoded 'A' for example, the browser still opens, albeit with it displaying an error as the URL does not exist.

/tellraw @s [{"text":"%41 'A'","color":"yellow","click_event": {"action":"open_url","url": "https://%41"}}]

Including any of the following characters anywhere after the '//' results in the browser not opening.

%2F '/'

%3F '?'

%5C '\'

%00 null

I believe with (probably) every other character, at least a new browser window opens, even if the URL isn't navigated to.

Using Firefox, in case this is somehow different between browsers.

Linked issues

Comments 2

I believe this is intended, since it is an invalid URL.

I can confirm. For me (running Linux) Minecraft opens a new browser window, or simply opens the browser if it wasn't already open. Although you need an invalid URL to replicate the bug (as apple502j noted), the handling of invalid URLs is inconsistent and appears to be undefined, so there is still a valid bug here.

Here are the URLs I tested:

URL

Description

Behaviour

Intended?

Notes

https://google.com

Normal, well-formed URL

URL opens in browser

Yes

https://dweafer

URL without a top-level domain (TLD)

URL opens in bowser

Very likely

https://abc%2F

URl without TLD, with url-encoded character

New browser window opens (see above)

No

This is the kind of URL that the bug report is describing

https://google.com/search?q=abc%2F

Well-formed URL that contains a url-encoded character

URL opens in bowser

Yes

I also use Firefox.

mattp12

(Unassigned)

Confirmed

Platform

Low

Commands, UI

1.19, 1.19.1 Pre-release 2, 1.19.1 Pre-release 3, 1.19.1 Pre-release 4, 1.19.1 Pre-release 5, ..., 25w02a, 25w03a, 25w04a, 25w05a, 25w06a

Retrieved