Linking to URLs from HTML5 version

  • #1, by lukasMonday, 06. April 2020, 18:33 4 years ago
    I use the same project to build for several platforms. My Windows and MacOS versions have objects that, when clicked, execute a script opening a URL in the standard browser (the ususal startDefaultBrowser("https://XXXXX")). When building the game for HTML5, these links won’t work. Is there a command that keeps the HTML5 version of the game in one tab and opens a URL in a new one (or a new browser window)?

    Newbie

    10 Posts


  • #2, by SimonSTuesday, 07. April 2020, 15:31 4 years ago
    js([[window.open(url, '_blank').focus();]])

    Thread Captain

    1582 Posts

  • #3, by lukasTuesday, 14. April 2020, 11:17 4 years ago
    js([[window.open(url, '_blank').focus();]])
    Thanks! Just in case someone stumbles upon this, the link has to be formatted with single quotation marks ('https://www.visionaire-studio.net') and after a bit of experimenting I'd recommend to use 'self' instead of 'blank', as changing the tab seems to crash the game in Firefox.

    Newbie

    10 Posts