Skip to content

Commit

Permalink
Hack
Browse files Browse the repository at this point in the history
  • Loading branch information
Avaer Kazmer committed Sep 19, 2019
1 parent 5a0c1bf commit 1af1391
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/WindowVm.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ class WorkerVm extends EventTarget {
.then(followUrl => new Promise((accept, reject) => {
const src = window.location.origin +
(options.args.options.url.startsWith('data:') ?
`${window.location.origin}/xr-engine-${Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 5)}.html`
`/xr-engine-${Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 5)}.html`
:
options.args.options.url.replace(/^[a-z]+:\/\/[a-zA-Z0-9\-\.]+(?::[0-9]+)?/, ''));
console.log('latch src 1', options.args.options.url, src, `${window.location.origin}/xr-engine-${Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 5)}.html`);
const dst = `\
<!doctype html>
<html>
Expand All @@ -62,6 +63,8 @@ class WorkerVm extends EventTarget {
mc.port1.onmessage = () => {
iframe.src = src;

console.log('latch src 2', src);

iframe.addEventListener('load', () => {
const {queue} = messageChannel.port2.handleMessage;

Expand Down

0 comments on commit 1af1391

Please sign in to comment.