Pop up protection! Forum Home > Construct 2 General > How do I....? |
Post Reply
|
| Author | |
Post Options
Quote Reply
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? |
|
![]() |
|
Post Options
Quote Reply
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 |
|
![]() |
|
Post Options
Quote Reply
Posted: 16 Apr 2012 at 9:50pm |
|
|
Thank you @Ashley,
|
|
![]() |
|
Post Options
Quote Reply
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 |
|
![]() |
|
Post Options
Quote Reply
Posted: 26 Apr 2012 at 7:34pm |
|
|
@Legora THANK YOU!!!!!
|
|
![]() |
|
Post Options
Quote Reply
Posted: 26 Apr 2012 at 8:15pm |
|
|
@legora: You might prefer using a single condition ->
"Mouse: on object clicked 'Sprite'". |
|
![]() |
|
Post Options
Quote Reply
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.
|
|
![]() |
|
Post Reply
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |