Linking to URLs from HTML5 version

  • #1, by lukasMonday, 06. April, 18:33 4 months 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

    7 Posts


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

    Thread Captain

    1352 Posts

  • #3, by lukasTuesday, 14. April, 11:17 4 months 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

    7 Posts

Write post