mojira.dev
MC-251422

Demo Mode: The "Purchase Now!" link does not use the confirmation screen

The bug

When clicking on the "Purchase Now!" CTA in the Demo Mode introduction popup, the Minecraft Store link is immediately opened, without showing the link confirmation ("Do you want to open this link...?") screen.

This is inconsistent with other buttons in the game's UI that open a web link.

To reproduce

  1. Run the game in Demo mode. (You can do this manually by specifying the correct arguments to the client.jar or you can select a Mojang account that has not brought the game in the Launcher.)

  2. Click "Play Demo World" to generate/enter the demo world.

  3. When the Demo Mode introduction popup appears, click the "Purchase Now" button on the left.

Code analysis (Official Mappings)

Other buttons

When any other button that opens a link is clicked, the callback function looks something like this:

this.minecraft.setScreen(new ConfirmLinkScreen($$0 -> {
    if ($$0) {
        Util.getPlatform().openUri(GUIDE_LINK);
    }
    this.minecraft.setScreen(this);
}, GUIDE_LINK, true));

As you can see, the whole thing is wrapped in a ConfirmLinkScreen that will only open the link if the "Yes" button is clicked.

Purchase Now! button

However, when the "Purchase Now!" button is clicked, this callback is executed:

$$0.active = false;
Util.getPlatform().openUri("http://www.minecraft.net/store?source=demo");

This simply disables the button and then directly opens the URL, without opening a ConfirmLinkScreen. It should probably look similar to the first example.

Screenshots

The Demo Mode introduction popup:

[media]

Attachments

Comments 2

This may be WAI; the link confirmation is presumably there so you can see the actual URL and decide if it's safe to go to that site, but this link in particular is put there by the devs and goes to a trusted site.

While you are correct in saying that the link is hardcoded and therefore can likely be trusted, it is also useful to know the target of a link before you click it and have the option to copy the link so that the web page can be opened manually. (As provided by web browsers, for example.) Also, there's no indication that the button is opening a web page - you could reasonably expect the purchase to happen in-game or through the launcher.

Finally, note that every other link in the game's menus uses the confirmation screen, even though they are also hardcoded. Therefore the fact that the purchase link directly opens is inconsistent with how the rest of the UI operates, making it even more likely to cause confusion.

[media]

MMK21

(Unassigned)

Confirmed

Platform

Low

UI

22w18a, 22w19a, 1.19 Pre-release 2, 1.19.2, 22w42a, ..., 24w13a, 24w14a, 1.20.5 Pre-Release 1, 1.20.5 Pre-Release 4, 1.21

Retrieved