HTML5 Open URL in same tab

mtombasco

  • Posts: 2
     I'm trying to add a button to take the user to a Facebook page, but when I use the "Open URL in Browser" block it always opens in a new tab, and it tends to get blocked by a pop-up blocker.  Is there a way to open the URL in the same tab, or the get around the pop-up blocker?  I'm using HTML5, and ideally want to post the game as a mobile friendly option on Twitch.

Thanks,

 - Mario

JeffreyDriver

  • Posts: 2262
That doesn't happen to me. Maybe it's browser dependent? What browser are you using? It could also be down to people's personal security settings.

mtombasco

  • Posts: 2
JeffreyDriver,

     I've tried using Safari, Firefox, and Chrome, on both a MacBook and an iPhone.  On the desktop version it worked fine, and if the browser did not open the link immediately it at least asked if I wanted to open a pop-up.  On the mobile version I was able to get the same result if I changed the security settings for each browser.  My concern is that on the mobile versions of Safari and Firefox, before I change the security settings it looked like the buttons didn't do anything.  I don't mind asking to open the link, but I don't want someone playing the game to click on a button and see nothing at all happen.  I've included an image of my code for reference.

Thanks,

 - Mario






alohabrij

  • Posts: 15
Hi Mario,

I was looking for same thing.  I have used the solution provided in the below thread in an HTML5 game and its working fine in IOS , Windows & Android.

Have below code in custom code and it works , try out.

flash.Lib.getURL(new openfl.net.URLRequest("www.________.com"), "_self");

Solution thread provided by captaincomic :   http://community.stencyl.com/index.php?topic=44906.0