Loadscreen freezes when opening a Discord link in a new window?

Is there any way to keep the loadscreen functioning when a link is opened in a new window?

Best Regards,
Badger

1 Like

Anyone got any ideas?

Is there any way for you to actually describe the issue you’re having?

Anyone got any idea?

1 Like

No matter how I open a link via the loadscreen, it will freeze the UI page and the player will not be able to actually get in the server. I’ve tried opening it via JS and Anchor tags to no actual avail.

1 Like

Again, define ‘open a link’.

1 Like

Trying to open a Discord link in an external window _blank via JS or Anchor tag via the loadscreen freezes the loadscreen for the player and they can never actually get into the game. Hope that further clarifies it. Sorry about that.

Try this code:
<a href="https://discord.gg/yourdiscord" class="icon brands fa-discord" target="_blank" onclick="window.invokeNative('openUrl', 'https://discord.gg/yourdiscord');"><span class="label">Discord</span></a> its working for me.

1 Like

I will try this when I get a chance, thanks!

No problem, im using this code in my Loading screen and its working so i think is gona work for you.

1 Like

The optimizaded code:

<script>
const elements = document.querySelectorAll('a').forEach(element => {
	element.addEventListener('click', e => {
  	e.preventDefault()
    
    window.invokeNative('openUrl', e.target.href)
  })
});
</script>

You just only need this and all links working

1 Like