[SOLVED] Window.open does not work on ios safari

we are creating a game and need to open some windows on button clicks,
this does not seem to work on ios safari due to pop-up blocking.
we already looked at other projects and are using the same code as the flappy bird tutorial project.
It seems to work there, but not in ours.
We also looked at some more general javascript solutions, but these also seem fruitless.
Any help is appreciated, thanks!

SLAP!

1 Like

Which buttons are meant to open new windows?

1 Like

the red button at the top is easiest to test, but there are a few. mainly the share buttons on the game over screen.

alright, the solution is found!
apparently it does not work when called after a button press, but it does work when called through an event. The buttons in our example are sprites that fire an event when clicked on, while our project worked with buttons. thanks for taking a look Yaustar.

SLAP!

Nice one in finding the solution and thank you for posting it here.

Yes, as a protection measure, browsers tend to only have operations like this only happen on the event callback.

Surprised that it worked elsewhere with your other method :thinking:

1 Like

Very good question and answers. I also found the solution to my problem here, thanks to everyone! :+1:

1 Like