exokitxr / exokit

Native VR/AR/XR engine for JavaScript 🦖
MIT License
997 stars 117 forks source link

window.location.href = ... throws error #778

Open machenmusik opened 5 years ago

machenmusik commented 5 years ago

ML1 using 0.0.516

If you make a simple webpage with script in body that does a redirect by assigning to window.location.href, an error is thrown

02-19 23:22:01.016  2877     3 E exokit  : ReferenceError: exokit is not defined
02-19 23:22:01.016  2877     3 E exokit  :     at Location.window.location.on.href (/package/src/Window.js:1117:7)
02-19 23:22:01.016  2877     3 E exokit  :     at Location.emit (events.js:188:13)
02-19 23:22:01.016  2877     3 E exokit  :     at Location.EventEmitter.emit (domain.js:441:20)
02-19 23:22:01.016  2877     3 E exokit  :     at Location.update (/package/src/Location.js:68:10)
02-19 23:22:01.016  2877     3 E exokit  :     at Location.set href [as href] (/package/src/Location.js:28:12)
02-19 23:22:01.016  2877     3 E exokit  :     at http://learned.glitch.me/:6:26
02-19 23:22:01.016  2877     3 E exokit  :     at Object._runJavascript (/package/src/utils.js:71:15)
02-19 23:22:01.016  2877     3 E exokit  :     at Resource.ownerDocument.resources.addResource [as getCb] (/package/src/DOM.js:1683:13)
02-19 23:22:01.016  2877     3 E exokit  :     at Promise (/package/src/core.js:110:12)
02-19 23:22:01.016  2877     3 E exokit  :     at new Promise (<anonymous>)
avaerkazmer commented 5 years ago

This sounds like it’s probably not ml-related; it’s just href handling.

The worker threads pr (https://github.com/webmixedreality/exokit/pull/760) completely changes the notion of a user window so it might make sense to fix over there.

machenmusik commented 5 years ago

Is there some other way that works? ML1 virtual keyboard shift doesn't stick so I can't type colon for port number... so this was a workaround. window.location.assign() didn't work either

avaer commented 5 years ago

No, but this seems like a bug that's not ML related. Additionally, there is a PR for the shift key functionality.

machenmusik commented 5 years ago

(Removed ML1 from bug title, given the discussion above.)