xhr request support loading from file system

when we start chrome with --allow-file-access-from-files.
chrome will return status 0 when we start a XMLHttpRequest for las/laz file.
This commit is contained in:
holy kitty in the universe 2018-04-20 11:23:51 +08:00 committed by GitHub
parent d4bf5d1c24
commit 1f333999f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,7 +39,7 @@ Potree.LasLazLoader = class LasLazLoader {
xhr.overrideMimeType('text/plain; charset=x-user-defined');
xhr.onreadystatechange = () => {
if (xhr.readyState === 4) {
if (xhr.status === 200) {
if (xhr.status === 200 || xhr.status === 0) {
let buffer = xhr.response;
this.parse(node, buffer);
} else {