x3dom / x3dom

X3DOM. A framework for integrating and manipulating X3D scenes as HTML5/DOM elements.
http://x3dom.org
Other
813 stars 271 forks source link

The browser may automatically refresh when loading a scene.(Sorry, this is caused by HbuilderX built-in server) #1270

Closed microaaron closed 1 year ago

microaaron commented 1 year ago

https://user-images.githubusercontent.com/16946786/233165572-5024cc1a-5a56-4f24-8407-6eee085f6a75.mp4

The browser automatically refreshes several times.↑ In order to eliminate interference, I removed all scripts except https://x3dom.org/download/1.8.2/x3dom-physics.debug.js

This problem also exists on PC, but it is not easy to reproduce. It seems that lower performance systems or more loaded models are more prone to this problem.

andreasplesch commented 1 year ago

Strange. Could it have to do with ammo.js ?

microaaron commented 1 year ago

Sorry, this is caused by HbuilderX built-in server, which injects livereload script in HTML files.

<script>document.write('<script src="//' + (location.host || 'localhost').split(':')[0] + ':35929/livereload.js?snipver=1"></' + 'script>')</script>
<script>document.addEventListener('LiveReloadDisconnect', function() { setTimeout(function() { window.location.reload(); }, 500); })</script>
andreasplesch commented 1 year ago

ok