# How to open a link without leaving XR experience

**URL:** <https://forum.babylonjs.com/t/how-to-open-a-link-without-leaving-xr-experience/26043>\
**Category:** Questions\
**Created:** [December 13, 2021, 10:13pm UTC](https://forum.babylonjs.com/t/how-to-open-a-link-without-leaving-xr-experience/26043 "2021-12-13T22:13:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bruchansky](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bruchansky/32/20546_2.png) [@bruchansky](https://forum.babylonjs.com/u/bruchansky)\
**Post date:** [December 13, 2021, 10:13pm UTC](https://forum.babylonjs.com/t/how-to-open-a-link-without-leaving-xr-experience/26043/1 "2021-12-13T22:13:39Z")

</div>

Hi, I would like to open a link from a self-hosted babylonjs page to another one, but without exiting the VR session on the Oculus Quest browser. It’s possible apparently but I can’t find an example or guide to make it work.

I’ve asked on github but I’m doing something wrong apparently, it doesn’t work automatically for me. I use this on my destination page:

```auto
try {
  var xr = await scene.createDefaultXRExperienceAsync({
       floorMeshes: [env.ground]
  });
  } catch (e) {
     // no XR support
  }

```

> <https://github.com/BabylonJS/Babylon.js/issues/9860#issuecomment-987254372>
>
> When in VR, I'd like to be able to click on a link to a WebXR experience and tra…nsition to that experience without breaking immersion. This is possible now via a feature of the WebXR API: https://github.com/immersive-web/navigation#api-proposal
> 
> A-Frame already has this baked into their \["link" component\](https://aframe.io/docs/1.1.0/components/link.html) which they describe as follows:
> 
> \_The link component connects between experiences and allows for traversing between VR web pages. When activated via an event, the link component sends the user to a different page, just like a normal web page redirect. To maintain VR across pages, the following conditions must apply:\_
> 
> \_The destination Web page listens to the window \[sessiongranted\] event and enters VR. A-Frame experiences behave this way by default.\_
> 
> I believe the Oculus Browser is the only browser that has this feature, but letting our users do this from that browser would be incredibly powerful. @RaananW

Thanks for your help!

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [December 13, 2021, 11:01pm UTC](https://forum.babylonjs.com/t/how-to-open-a-link-without-leaving-xr-experience/26043/2 "2021-12-13T23:01:36Z")

</div>

Assigned @RaananW on December 13, 2021, 11:01pm UTC



---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [December 14, 2021, 11:49am UTC](https://forum.babylonjs.com/t/how-to-open-a-link-without-leaving-xr-experience/26043/3 "2021-12-14T11:49:56Z")

</div>

Surprising enough, we just had a thread about this 🙂

You will need to enable the feature in chrome://flags, and use our default XR experience. Here is the thread (and the working example)

> [@How to switching scenes in vr glass](https://forum.babylonjs.com/t/how-to-switching-scenes-in-vr-glass/25576/25):
>
> I got an oculus quest2 device, and test the demo I had written. As you can see from the video, when I enter the second page from the panoramic mode of the first page, it cannot automatically enter the panoramic mode of the second page. I don’t quite understand the security mechanism here, I don’t know if this is normal? the git repo: the pages url: [https://issuebox.github.io/scenes-switch/index.html](https://issuebox.github.io/scenes-switch/index.html)[https://issuebox.github.io/scenes-switch/index2.html](https://issuebox.github.io/scenes-switch/index2.html)

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [December 14, 2021, 3:08pm UTC](https://forum.babylonjs.com/t/how-to-open-a-link-without-leaving-xr-experience/26043/4 "2021-12-14T15:08:11Z")

</div>

Unassigned @RaananW on December 14, 2021, 3:08pm UTC



---

<div class="post-metadata">

**Author:** ![bruchansky](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bruchansky/32/20546_2.png) [@bruchansky](https://forum.babylonjs.com/u/bruchansky)\
**Post date:** [January 7, 2022, 9:37am UTC](https://forum.babylonjs.com/t/how-to-open-a-link-without-leaving-xr-experience/26043/5 "2022-01-07T09:37:33Z")

</div>

Thanks for your answer, I can’t wait for this to be activated by default in Chrome!
