Pop up protection!

Forum Home Forum Home > Construct 2 General > How do I....?
 Post Reply Post Reply
Author
916 Rep
Post Options Post Options   Quote rgros Quote  Post ReplyReply Direct Link To This Post Topic: Pop up protection!
    Posted: 15 Apr 2012 at 6:06pm
Hi,

I have an event triggering a "open new window" URL

This however always triggers the Popup protection message.

Is there a way to make a new window open like a regular LINK?

Back to Top

Scirra Developer
78,205 Rep
Post Options Post Options   Quote Ashley Quote  Post ReplyReply Direct Link To This Post Posted: 16 Apr 2012 at 3:10pm
The best thing you can do is make sure you open a window in a user input event, like 'On mouse button clicked' or 'On key pressed'. Hopefully then the browser recognises that the window opening is an action the user intended, and not some spammy popup advert.

However, this doesn't always work - spammers still use the same method for opening popups. So some browsers (Firefox especially IIRC) will simply block all window opens anyway, and the user must approve it by clicking the notification. Users are probably fairly used to this. So you can either just have a note (e.g. "Warning: opens new window") so the user knows when they see the "popup blocked" it was actual content rather than some popup ad. Or you can just navigate the current page - that will end the game, but it always works. Or, just put the hyperlink in the page HTML outside your game.

This is more of a general problem with web development than anything specific to C2 - everyone hates popups, and if you try to open a new window, you're at the mercy of popup blockers.

Edited by Ashley - 16 Apr 2012 at 3:11pm
Back to Top
916 Rep
Post Options Post Options   Quote rgros Quote  Post ReplyReply Direct Link To This Post Posted: 16 Apr 2012 at 9:50pm
Thank you @Ashley,
Back to Top
1,162 Rep
Post Options Post Options   Quote legora Quote  Post ReplyReply Direct Link To This Post Posted: 26 Apr 2012 at 7:19pm
I had the same problem too and fix it with.

Mouse button released
Mause cursor is over sprite     Browser goes to http:// in new windows.

This works great
Back to Top
916 Rep
Post Options Post Options   Quote rgros Quote  Post ReplyReply Direct Link To This Post Posted: 26 Apr 2012 at 7:34pm
@Legora THANK YOU!!!!!
Back to Top

Moderator
28,473 Rep
Post Options Post Options   Quote Kyatric Quote  Post ReplyReply Direct Link To This Post Posted: 26 Apr 2012 at 8:15pm
@legora: You might prefer using a single condition ->
"Mouse: on object clicked 'Sprite'".
Back to Top
1,162 Rep
Post Options Post Options   Quote legora Quote  Post ReplyReply Direct Link To This Post Posted: 26 Apr 2012 at 11:54pm
It is better if you want to open URL in the same window, but when you want to open it in new window Firefox shows pop up protection, on chrome and IE works fine i think.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down