Google-chrome can't locally view my webGL Three.js webpages in Ubuntu

柔情痞子 提交于 2019-12-12 04:01:05

问题


chrome://gpu shows green for everything and "WebGL: Hardware accelerated WebGL multisampling: Hardware accelerated"

my version is: Google Chrome 31.0.1650.63

and I've set the flag "

Override software rendering list Mac, Windows, Linux, Chrome OS, Android
Overrides the built-in software rendering list and enables GPU-acceleration on unsupported system configurations. #ignore-gpu-blacklist

"

to enabled.

But if I 'File -> Open -> index.html' where the index.html has webGL and three.js I see like half of it... It's odd.

BUT, it does work for normal .htmls' and oddly works fine for the exact same files I have webhosted.

So this: http://www.eden.rutgers.edu/~shahan1/nurp/ works and opens up fine,

but when I download the exact same folder and chmod 777

file:///home/sa/Desktop/3Dweb/public_html/nurp/index.html

everything and whatnot it opens up certain aspects like the upper left .gif and that's it.

and I've tried things like

"google-chrome --ignore-gpu-blacklist"

"google-chrome --enable-webgl --ignore-gpu-blacklist"

and " google-chrome --allow-file-access-from-files" which i thought would work what with local files... but no dice.

but perhaps i'm not using them right?

is it "google-chrome index.html -flag"? or "google-chrome -flag index.html"?

Would really like to view them locally it's such a pain to edit over ssh (slow connection). I'd rather locally edit and then upload when it's done.


回答1:


The issue is Chrome doesn't allow web pages to read local files. Otherwise the bad guys could make HTML pages, ask you to save them and load them locally and then upload your local files to their sever.

You can override this but I don't recommend it. Rather run your own server. The simplest way is to use python then open a terminal and type

python -m SimpleHTTPServer

Then go to

http://localhost:80000

At some point you'll likely find that has limits (like doesn't support video well) in which case see this answer.

What is a faster alternative to Python's http.server (or SimpleHTTPServer)?



来源:https://stackoverflow.com/questions/20624863/google-chrome-cant-locally-view-my-webgl-three-js-webpages-in-ubuntu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!