# Window.location not available

**URL:** https://forum.makecode.com/t/window-location-not-available/11023
**Category:** Help
**Created:** [November 22, 2021, 4:37pm UTC](https://forum.makecode.com/t/window-location-not-available/11023 "2021-11-22T16:37:26Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![gian1922](https://avatars.discourse-cdn.com/v4/letter/g/3d9bf3/32.png) [@gian1922](https://forum.makecode.com/u/gian1922)
#### Post date: [November 22, 2021, 4:37pm UTC](https://forum.makecode.com/t/window-location-not-available/11023/1 "2021-11-22T16:37:26Z")

</div>

Hello everyone!

I have started working on my first game a few weeks ago and now I’m almost done and ready to publish the finished version. I’m facing an issue that is related to the main purpose of the game, which is to redirect users who complete the game to an external website. How could I achieve this? I thought that entering a very simple `window.location` right in my game over block would do the job but it seems I cannot do that.

Could anyone kindly help me out? Thanks a lot in advance 🙂

---

<div class="post-metadata">

### Author: ![personalnote](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/personalnote/32/31359_2.png) [@personalnote](https://forum.makecode.com/u/personalnote)
#### Post date: [November 25, 2021, 6:00pm UTC](https://forum.makecode.com/t/window-location-not-available/11023/2 "2021-11-25T18:00:30Z")

</div>

I do not think that is possible. Maybe you could tell the player to go to this website once they complete the game with a splash block?

---

<div class="post-metadata">

### Author: ![gian1922](https://avatars.discourse-cdn.com/v4/letter/g/3d9bf3/32.png) [@gian1922](https://forum.makecode.com/u/gian1922)
#### Post date: [November 29, 2021, 5:15pm UTC](https://forum.makecode.com/t/window-location-not-available/11023/3 "2021-11-29T17:15:40Z")

</div>

unfortunately the URL in question is pretty long and it could be very difficult for the users to enter it in a separate navigation bar. Do you think I could achieve this with the help of an extension?

---

<div class="post-metadata">

### Author: ![felixtsu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/felixtsu/32/12024_2.png) [@felixtsu](https://forum.makecode.com/u/felixtsu)
#### Post date: [November 29, 2021, 5:17pm UTC](https://forum.makecode.com/t/window-location-not-available/11023/4 "2021-11-29T17:17:48Z")

</div>

Try a qrcode

> **[foobar](https://arcade.makecode.com/46613-39425-23898-08271)**
>
> 用❤️创造，Microsoft MakeCode Arcade出品。

---

<div class="post-metadata">

### Author: ![thegreatone](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/thegreatone/32/5414_2.png) [@thegreatone](https://forum.makecode.com/u/thegreatone)
#### Post date: [November 29, 2021, 5:17pm UTC](https://forum.makecode.com/t/window-location-not-available/11023/5 "2021-11-29T17:17:59Z")

</div>

There is another topic for this.

> [@WebSocket extension (experimental)](https://forum.makecode.com/t/websocket-extension-experimental/4661/1):
>
> Hello everyone!
> 
> This extension provide a WebSocket like API to build multiplayer game on the web (and hardware). It’s still very much a work in progress. **Read below, it will not work as is in the editor**.
> 
> - demo [https://pelikhan.github.io/pxt-sockets/](https://pelikhan.github.io/pxt-sockets/)
> - github [https://github.com/pelikhan/pxt-sockets](https://github.com/pelikhan/pxt-sockets)
> 
> The simulation support is rather clunky right now because it can’t be tested in game yet. However if you copy custom.js/loader.js into your generate repo, you’ll be able to talk to WSS.

---

<div class="post-metadata">

### Author: ![gian1922](https://avatars.discourse-cdn.com/v4/letter/g/3d9bf3/32.png) [@gian1922](https://forum.makecode.com/u/gian1922)
#### Post date: [November 30, 2021, 5:50pm UTC](https://forum.makecode.com/t/window-location-not-available/11023/6 "2021-11-30T17:50:18Z")

</div>

Do you know how could I import a QR code as an asset? Thanks

---

<div class="post-metadata">

### Author: ![gian1922](https://avatars.discourse-cdn.com/v4/letter/g/3d9bf3/32.png) [@gian1922](https://forum.makecode.com/u/gian1922)
#### Post date: [November 30, 2021, 5:50pm UTC](https://forum.makecode.com/t/window-location-not-available/11023/7 "2021-11-30T17:50:51Z")

</div>

I’m not sure I’ve understood what is happening there but the demo is not working (the game is not connecting to the WebSocket). Could it be integrated into a game?

---

<div class="post-metadata">

### Author: ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)
#### Post date: [November 30, 2021, 5:53pm UTC](https://forum.makecode.com/t/window-location-not-available/11023/8 "2021-11-30T17:53:47Z")

</div>

MakeCode Arcade does not allow you to access browser APIs like window.location so opening an external website automatically is not possible. This is mostly to prevent bad actors from writing games that open up malicious websites.

As for qr codes, there’s an extension for that: [QR Code extension](https://forum.makecode.com/t/qr-code-extension/1601)

---

<div class="post-metadata">

### Author: ![gian1922](https://avatars.discourse-cdn.com/v4/letter/g/3d9bf3/32.png) [@gian1922](https://forum.makecode.com/u/gian1922)
#### Post date: [December 1, 2021, 3:41pm UTC](https://forum.makecode.com/t/window-location-not-available/11023/9 "2021-12-01T15:41:40Z")

</div>

Thanks for the reply. I have tried to integrate it but unfortunately it is not working as stated by other users…
