MZ [Solved] Game stucked when opening a link in the external window

I modified the title screen and added an "About" button. This button is expected to open an external link on click. Now my problem is: when this button is clicked, the game gets freezed! Closing that external window won't bring the game to normal.

I tried to call the window.open() directly in F12 console, and the game ran well. It just not work in this plugin scenario. Could someone tell me where's wrong? :oops:

Part of my plugin javascript code:

Window_TitleCommand.prototype.makeCommandList = function () {
this.addCommand(TextManager.newGame, "newGame");
this.addCommand(TextManager.options, "options");
this.addCommand("About [(an emoji here)]", "aboutGame");
};
const _Scene_Title_createCommandWindow = Scene_Title.prototype.createCommandWindow;
Scene_Title.prototype.createCommandWindow = function () {
_Scene_Title_createCommandWindow.call(this);
this._commandWindow.setHandler("aboutGame", this.commandAboutGame.bind(this));
};
Scene_Title.prototype.commandAboutGame = function () {
window.open("https://example.com", "_blank");
};

Debugger. Seems that the CPU runs into some trouble after opening the external window?

[ATTACH type="full"]311873[/ATTACH]
When a command is OK'd, the game window deactivates, but in this case you're not passing control to any other interface element in your game, so it looks frozen.

You just need to reactivate the command window:
JavaScript:
    Scene_Title.prototype.commandAboutGame = function () {
        window.open("https://example.com", "_blank");
        this._commandWindow.activate();
    };
When a command is OK'd, the game window deactivates, but in this case you're not passing control to any other interface element in your game, so it looks frozen.

You just need to reactivate the command window:
JavaScript:
    Scene_Title.prototype.commandAboutGame = function () {
        window.open("https://example.com", "_blank");
        this._commandWindow.activate();
    };
Works perfectly, thank you!!
I really did not find that post in the websearch game, sorry 😳

Original thread: https://forums.rpgmakerweb.com/threads/solved-game-stucked-when-opening-a-link-in-the-external-window.170439/