Browser URL Target.

Discussion and feedback on Construct 2

Post » Tue Nov 04, 2014 1:24 pm

Hey everyone :D

I'm having some problems with the Browser plugin. When using the "open url in new screen", sometimes it opens it up as a new tab, which is I want it to do every time. And sometimes it opens things as popups.

Is there a way to ALWAYS open a new tab when going to an url?

thanks for any answer ^^
B
43
S
12
G
6
Posts: 446
Reputation: 6,802

Post » Tue Nov 04, 2014 1:48 pm

I believe Construct itself cannot handle this...it is browser specific and browser setting specific. So you say, open new window...and the browser settings determine if it is a new tab, or a new window
B
43
S
18
G
8
Posts: 500
Reputation: 8,445

Post » Tue Nov 04, 2014 2:23 pm

oh... it's such a simple html task though. target="_blank"

My problem is that sometimes browsers will block the pop ups like they're the devil. And i'll I want to do is let players visit my social pages when they choose to. A very common "share" button thing.
B
43
S
12
G
6
Posts: 446
Reputation: 6,802

Post » Tue Nov 04, 2014 3:54 pm

Sargas wrote:oh... it's such a simple html task though. target="_blank"

My problem is that sometimes browsers will block the pop ups like they're the devil. And i'll I want to do is let players visit my social pages when they choose to. A very common "share" button thing.


Incorrect.

target="_blank" can misbehave in different browsers based on browser setting ;)
B
43
S
18
G
8
Posts: 500
Reputation: 8,445

Post » Tue Nov 04, 2014 4:19 pm

@humanescape are you sure? I've been programming in html for quite some time now, and target blank always opens in a new tab in my experience.

could you be a bit more constructive with the reply please?
B
43
S
12
G
6
Posts: 446
Reputation: 6,802

Post » Tue Nov 04, 2014 4:31 pm

Sargas wrote:@humanescape are you sure? I've been programming in html for quite some time now, and target blank always opens in a new tab in my experience.

could you be a bit more constructive with the reply please?


Yes. Since you have been programming html for along time, you must be aware that html acts VERY differently on different browsers and settings.

Apparently one solution (I have not tried it) is adding to links style="target-new: tab;" . . . but if a user has there settings to force a new window instead of a tab I am not sure if that would fix that.

You need to find out what browsers / versions / settings are people using when the window is being opened in a new window vs. tab.
On-top of that, if you concern is a pop-up blocker...a pop-up blocker can block new tabs, not just new windows.


EDIT: Just to throw it out there, one of my apps in both IE 9 and Chrome open in a new tab, not a new window for me (I have not changed any of my settings of course). Perhaps you could post the app that is giving you issues?
B
43
S
18
G
8
Posts: 500
Reputation: 8,445

Post » Mon Oct 26, 2015 2:39 pm

I have the same problem almost one year later.

Newest Version of Chrome works fine. Newest Version of FF (default settings) blocks the new windows with the inbuilt popup blocker.

Also the Construct documentation states
Open URL in new window

Navigate to a given URL in a new window (or tab if the browser settings override). This continues to run the HTML5 game in the old window or tab.


How to change the default way to open the URL to "tab" instead of "window"? I doesn't need to work for customized browser settings, but should at least work for the default settings.
B
7
S
1
G
1
Posts: 10
Reputation: 427

Post » Tue Oct 27, 2015 11:25 am

Maybe you can try handling this with the execute JavaScript action from the browser object. But as far as I can see, it's not possible to override the user's settings.
B
135
S
33
G
17
Posts: 1,557
Reputation: 20,717


Return to Construct 2 General

Who is online

Users browsing this forum: brupibo and 10 guests