Chrome浏览器的Web工作者设置 [英] Web worker settings for chrome

查看:149
本文介绍了Chrome浏览器的Web工作者设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我制作了一个适用于Firefox但不适用于GoogleChrome的网站。
该网站使用网络工作者,我得到常见的错误消息:

 Uncaught SecurityError:未能创建一个worker:script 
'file:///home/useraccount/School/MasterThesis/Code/physijs_worker.js'
不能从原始'null'访问。

我已经阅读过这篇文章,并且在本教程结束时对其进行了很好的解释( http://www.html5rocks.com/en/tutorials/workers/basics/ ),在A单词在安全部分。



这是我的谷歌浏览器版本:

  Google Chrome 32.0 .1700.107(官方版本248368)

操作系统Linux

闪烁537.36(@ 165586)

JavaScript V8 3.22.24.17

用户代理Mozilla / 5.0(X11; Linux x86_64)AppleWebKit / 537.36(KHTML,如Gecko)Chrome / 32.0.1700.107 Safari / 537.36

命令行/ usr / bin / google-chrome
- 允许从文件访问--flag-switches-begin
--ignore-gpu-blacklist --flag-switch-end

在这里我们可以看到--allow-access-from-files标志确实被设置。
我在UBUNTU 13.10上运行它。



我也检查过URL链接是否完整,正如很多论坛所建议的。



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

对于一些建议,这个问题可能会很好。

解决方案

在打开之前,必须先关闭Chrome的所有窗口 - allow-file-

要在Ubuntu中打开它,只需写 google-chrome --allow-文件访问从文件在您的终端。

I have made a website which works on Firefox but not on GoogleChrome. The website uses a web worker and i get the common error message:

 "Uncaught SecurityError: Failed to create a worker: script at
    'file:///home/useraccount/School/MasterThesis/Code/physijs_worker.js' 
  cannot be accessed from origin 'null'."

I have read about this, and it is very well explained at the end of this tutorial (http://www.html5rocks.com/en/tutorials/workers/basics/), in the A word on Security section.

This is my google-chrome version:

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

Here we can see that the --allow-access-from-files flag truly are set. I am running it on my UBUNTU 13.10.

I have also checked that the URL link are complete, as many forums suggests.

There website are using Three.js and Physi.js.

It would be nice with some suggestions, on what the problem can be.

解决方案

You have to close all the windows of Chrome before opening it with --allow-file-access-from-files flag on.

To open it in Ubuntu simply write google-chrome --allow-file-access-from-files in your terminal.

这篇关于Chrome浏览器的Web工作者设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆