User Main Menu Preferences newBrowserTab: false is ignored and still opens in a new browser tab

Using the suggestions made by @gutow in this thread, I am finding that when I set "newBrowserTab":"false" the URL continues to open in a new window for both relative and absolute URLs. What is the criteria for making a URL open in the current window?

{
    "menus": [
        {
            "id": "jp-mainmenu-file",
            "items": [
                {
                    "disabled": true,
                    "command": "hub:control-panel",
                },                                
                {
                    "command": "help:open",
                    "rank": 99,
                    "args": {"text": "Go to relative path",  "url":"/my/relative/path", "newBrowserTab":"false"}
                },
                {
                    "command": "help:open",
                    "rank": 100,
                    "args": {"text": "Gutow Homesite absolute path", "url":"https://cms.gutow.uwosh.edu/Gutow", "newBrowserTab":"false"}
                }
            ]
        }
    ]
}

The related JupyterLab code

I think you need to use "newBrowserTab":false (without quotes) as the “false” string is truthy.

2 Likes

Ah, :man_facepalming:, thanks for that.

Updating it to "newBrowserTab":false makes a new tab open in the editor panel, and not as a widow.open() replacement for the current page.

Would I need to override the help-extension to allow for window.open(url, target) to use target="_self"?

1 Like