Skip to content

Commit 453a0a6

Browse files
author
Avaer Kazmer
committed
Small url loading bugfix in demo page
1 parent 5302a41 commit 453a0a6

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

index.html

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -273,15 +273,6 @@ <h3>Examples</h3>
273273
xrEngine.addEventListener('canvas', e => {
274274
const canvas = e.data;
275275
document.getElementById('iframe-wrapper').appendChild(canvas);
276-
277-
const {u} = parseQuery(window.location.search);
278-
if (u) {
279-
setTimeout(() => {
280-
_unloadLink(0);
281-
_unloadLink(0);
282-
_loadLink({href: u, innerText: 'URL'});
283-
});
284-
}
285276
});
286277
xrEngine.addEventListener('message', e => {
287278
const {data} = e;
@@ -302,6 +293,14 @@ <h3>Examples</h3>
302293
}
303294
});
304295

296+
const {u} = parseQuery(window.location.search);
297+
if (u) {
298+
while (tabs.childNodes.length > 0) {
299+
_unloadLink(0);
300+
}
301+
_loadLink({href: u, innerText: 'URL'});
302+
}
303+
305304
let result;
306305
if (navigator.xr) {
307306
try {

0 commit comments

Comments
 (0)