Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Bug with opening external links?

A topic by Gawaak created Apr 26, 2024 Views: 208
Viewing posts 1 to 1

I added a link to my discord server in an html5 game, but clicking on it doesn't work. So I checked the source code, and this snippet seems to handle opening url to a browser window:

It fails if the protocol is not http or https, but upon logging the URL object u, I get this:

The protocol is https: and not http as it should be.

It also works properly if I edit the first code snipped to allow http: and https: instead of http and https.

Is it a bad config on my end or is there indeed a bug in itch.io's code?