Pop up protection!

Get help using Construct 2

Post » Sun Apr 15, 2012 6:06 pm

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?

B
28
S
2
Posts: 69
Reputation: 1,491

Post » Mon Apr 16, 2012 3:10 pm

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.Ashley2012-04-16 15:11:03
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Mon Apr 16, 2012 9:50 pm

Thank you @Ashley,
B
28
S
2
Posts: 69
Reputation: 1,491

Post » Thu Apr 26, 2012 7:19 pm

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
B
10
S
3
G
3
Posts: 54
Reputation: 3,317

Post » Thu Apr 26, 2012 7:34 pm

@Legora THANK YOU!!!!!
B
28
S
2
Posts: 69
Reputation: 1,491

Post » Thu Apr 26, 2012 8:15 pm

@legora: You might prefer using a single condition ->
"Mouse: on object clicked 'Sprite'".
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Thu Apr 26, 2012 11:54 pm

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.
B
10
S
3
G
3
Posts: 54
Reputation: 3,317


Return to How do I....?

Who is online

Users browsing this forum: LeFuji and 19 guests