Web worker settings for chrome
Asked Answered
G

2

7

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.

Going answered 13/2, 2014 at 10:38 Comment(0)
G
9

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.

Going answered 14/2, 2014 at 5:49 Comment(0)
D
0

use live server extension in visual studio code and click on go live, this helped me

Diffuse answered 23/8, 2021 at 5:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.