javascript – chrome的Web worker设置

前端之家收集整理的这篇文章主要介绍了javascript – chrome的Web worker设置前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我创建了一个适用于Firefox但不适用于GoogleChrome的网站.
该网站使用Web工作者,我收到常见错误消息:
"Uncaught SecurityError: Failed to create a worker: script at
    'file:///home/useraccount/School/MasterThesis/Code/physijs_worker.js' 
  cannot be accessed from origin 'null'."

我已经读过这篇文章了,在本教程末尾(http://www.html5rocks.com/en/tutorials/workers/basics/),在“安全性”一节中有很好的解释.

这是我的谷歌Chrome版本:

Google Chrome   32.0.1700.107 (Official Build 248368) 

OS  Linux 

Blink   537.36 (@165586)

JavaScript  V8 3.22.24.17

User Agent  Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML,like Gecko) Chrome/32.0.1700.107 Safari/537.36

Command Line     /usr/bin/google-chrome 
  --allow-access-from-files --flag-switches-begin 
  --ignore-gpu-blacklist --flag-switches-end

在这里,我们可以看到–allow-access-from-files标志确实已设置.
我在我的UBUNTU 13.10上运行它.

正如许多论坛所建议的那样,我还检查了URL链接是否完整.

有网站使用Three.js和Physi.js.

关于问题可能是一些建议会很好.

解决方法

您必须先关闭Chrome的所有窗口,然后再打开–allow-file-access-from-files标志.

要在Ubuntu中打开它,只需在终端中写入google-chrome –allow-file-access-from-files.

原文链接:https://www.f2er.com/js/240771.html

猜你在找的JavaScript相关文章