Sys.open_url("http://www.fallenangelsoftware.com") --Bug? (SOLVED)

Hi,

When I execute: “sys.open_url(“http://www.fallenangelsoftware.com”)” on HTML5 version
is opens in a new tab? (it should open in same tab game was running in)

Please fix above problem in next release of Defold, thanks!

Jesse

It’s not a bug.

If you want to change the current page on html5 builds you can do

if html5 then
  html5.run("window.location = 'https://www.example.com';")
end
3 Likes

I need the website to load in same tab as game is running, how would I do that?
The above opens the website in a new tab?

For some reason, that changes the current window location and opens a new tab with Defold…

I just tested this and it should work however (tested with Chrome on Windows).

if html5 then
	html5.run("window.open('https://www.example.com/','_self');")
end
4 Likes

Works, thank you…

1 Like