Chrome allow file access from files no longer working (was using to see WebGL/three.js files)?

前端 未结 3 1371
眼角桃花
眼角桃花 2020-12-18 01:04

I was using a Chrome shortcut with allow-file-access-from-files in the target to work on my three.js student project files. But sometime this morning this stopped working an

相关标签:
3条回答
  • 2020-12-18 01:11

    The answer I came up with was to use Firefox instead of Chrome changing the security policy as detailed in https://github.com/mrdoob/three.js/wiki/How-to-run-things-locally

    Not a perfect answer but with a deadline looming it's the best workable answer for me right now as trying different variations of Chrome, trying Wamp and also Mongoose didn't work. If I had more time I would work out how to use Python or probably node.js as I've seen it mentioned a number of times as being the faster option.

    What gman stated is true, using the Chrome flag (and changing Firefox's security policy) does create a big security risk. But only if you use that shortcut (and it's tabs etc.) for anything other than accessing your own local files. I've been scrupulous about not using it for the internet but don't use this method if you can't be strict with yourself.

    Ideally I'd recommend beginning any project with node.js.

    0 讨论(0)
  • 2020-12-18 01:18

    Gman's answer is good. If you're in windows environment, and use npm for package management the easiest is to install http-server globally:

    npm install -g http-server

    Then simply run http-server in any of your project directories:

    Eg. d:\my_project> http-server

    Starting up http-server, serving ./ Available on: http:169.254.116.232:8080 http:192.168.88.1:8080 http:192.168.0.7:8080 http:127.0.0.1:8080 Hit CTRL-C to stop the server

    Easy, and no security risk of accidentally leaving your browser open vulnerable.

    0 讨论(0)
  • 2020-12-18 01:28

    DON'T USE THAT FLAG! You're opening yourself to having your online accounts being hacked and your local data stolen. Here are 2 proof of concept examples

    Run a simple server.

    It's super simple.

    • Here's one
    • Here's one.
    • Here's another.
    • And another.

    They won't take more than a couple of minutes to download and require no configuration

    0 讨论(0)
提交回复
热议问题