🤑 Indie game store🙌 Free games😂 Fun games😨 Horror games
👷 Game development🎨 Assets📚 Comics
🎉 Sales🎁 Bundles

Help with links to other Website pages in itch.io game

A topic by Jarrod Cooper created 65 days ago Views: 124 Replies: 4
Viewing posts 1 to 4

Hey Everyone, 

First post here, so I hope its in the right place. but basically, I've got a small problem with my first game uploaded here, it isn't so much a game, as what it is a small piece of work that links to my online sound design portfolio. 

You can see what I'm talking about here:  https://jarrod-cooper.itch.io/portfolio

In the game when you go through a door it takes you straight to that section of my online portfolio. (it works perfectly in Unity) However, when I play the build from within itch.io, it does not open a new tab with the given URL's

Does anyone know if this is a restriction from itch.io on opening other webpages from within an HTML game or if its a error that I have made. 

I would really appreciate anyone who could point me in the right direction or even help me. 

Cheers 

Jarrod.

Moderator

It could be simply from the game being embedded into an iframe. If Unity allows, give your links a target="_blank" attribute or, failing that, target="_top". Maybe there's a checkbox you can tick or something. Hope this helps!

Admin

You can also try running the game with your browser console open to see if there's any error message that indicates something is getting blocked. We don't manipulate the files you upload in any way, so there's no code of ours that would break it. However, we do embed the game in an iframe and there may be security limitations enforced by the browser that may change how the game works.

I have an issue that I think is related. My game uses http requests to save/load games to a server of mine, but such requests sent by builds hosted on itch.io always fail.

To make sure this wasn't a problem with my scripts, I made a tiny test app that sends a POST to http://httpbin.org/post. This is what it returns when I run it locally (and I get something similar when it's hosted on my own site, whether or not it's embedded in an iframe):

sending request...
sending to : http://httpbin.org/post
with fields hash=1337&name=test&version=404
Http POST complete!
Status=200
ResponseText={
    "args": {},
    "data": "",
    "files": {},
    "form": {
    "hash": "1337",
    "name": "test",
    "version": "404"
},
"headers": {
    "Accept": "*/*",
    "Accept-Encoding": "gzip, deflate",
    "Accept-Language": "en-US,en;q=0.5",
    "Connection": "close",
    "Content-Length": "61",
    "Content-Type": "application/x-www-form-urlencoded",
    "Host": "httpbin.org",
    "Origin": "http://localhost:56116",
    "Referer": "http://localhost:56116/MonkeyGame.html",
    "User-Agent": "Mozilla/5.0 (Windows NT 6.3; WOW64; rv:55.0) Gecko/20100101 Firefox/55.0"
},
"json": null,
"origin": "24.21.224.8",
"url": "http://httpbin.org/post"
}

But when I host & run the exact same thing on itch.io, I get:

sending request...
sending to : http://httpbin.org/post
with fields hash=1337&name=test&version=404
Http POST complete!
Status=0
ResponseText=

So maybe y'all aren't changing our uploaded files at all, but are you somehow blocking outgoing links/http requests? A security thing, maybe?

Admin

I replied to your email, but replying here in case anyone comes across it. 

All of our files are hosted on HTTPS. Depending on the request a browser may outright block the request for security reasons. I suggest configuring HTTPS on your server. There are a few (free) ways to do this: