Hi,
Running the following command on HTML5 version has issues:
html5.run("window.open('https://play.google.com/store/apps/details?id=com.fallenangelsoftware.redlightracer')")
On Windows 10
Microsoft Edge: Popup blocked
Mozilla Firefox: Popup blocked
Google Chrome: OK (opens in new tab)
Opera browser: Popup blocked
How can I fix the issues above, thanks!
Jesse
sven
February 18, 2019, 4:22pm
2
This is an issue with the browsers, and probably a security thing, nothing we can circumvent from Defold.
But it might be worth noting that such a call should be triggered from inside a on_input
function, since some browsers will block certain actions that does not occur during input events.
Try this trick:
I found a solution, maybe a little strange.
I have this in my on_input() pressed
if action.pressed then
if gui.pick_node(self.btnMoreGames, action.x, action.y) then
gui.play_flipbook(self.btnMoreGames,"btnMoreGames0002")
html5.run("pressed()")
end
end
and this in my custom index:
<script>
function pressed()
{
document.getElementById("canvas").onclick = function (e) {
openqkygames()
};
}
function openqkygames()
{
window.open("http://www.qkygame…
it works ok in html5 version of my game: LookYourLoot 1.06 (see html code here: Dragosha/hamster/index.html at master · Dragosha/Dragosha · GitHub )
Main thing is calling url opening function when user make a click.
1 Like