Google Chrome - Disabled file access for Chrome files for beta 8

I am developing an AJAX application using jQuery and Microsoft Seadragon technologies.
I need to have access to the html5 canvas function toDataURL.

Google Chrome uses the same origin rule for this function, which means that a page executed locally (with file:/// in the URL) does not satisfy the same origin rule and an exception is thrown.

In Chrome 7, starting an application with the --allow-file-access-from-files canvas.toDataURL() allows you to call canvas.toDataURL() from local files.

However, it seems that launching the beta version of Chrome 8 with the same option ( --allow-file-access-from-files ) does not allow calling canvas.toDataURL() in the local file.

Did Chrome --allow-file-access-from-files option, or has it just been disabled since it is a beta and not a full version?

Thank!

+27
file google-chrome ajax same-origin-policy local
Nov 24 '10 at 20:03
source share
5 answers

Looking at the problems for this , it is shown that the whole thing --allow-file-access-from-files been thrown.

  • "Firefox does this."
  • "How can we do this?"
  • some time passes
  • "Here are the patches"
  • "Passing! On the chest I wonder what happens in the next release of dev"
  • "Oh, it's broken." "Use the command line option" "ok"
  • "We sent!"
  • "WTF guys, you broke all my stuff! Why didn't you tell us before?"
  • Silence

In response to your problem
Indeed, it seems that this is something special for the beta version, I use Chrome 8.0.552.5 dev here, and --allow-file-access-from-files works as expected, I also tested it with Chromium 9.0.592.0 (66889) if it also works as expected.

I suspect that some changes have occurred in the dev branch. Unfortunately, finding something on a chrome tracker is almost impossible.

+46
Nov 24 '10 at 21:08
source share
โ€” -

Did you close all chrome instances before opening with a command line argument? You must do this for this parameter to work.

+22
03 Mar. '11 at 17:37
source share

To summarize all the answers so far.

Before starting chrome, make sure that chrome processes are not running.

Window

 -allow-file-access-from-files 

(with one dash)

Linux

 --allow-file-access-from-files 

(with two strokes)

+10
Apr 29 2018-11-21T00:
source share

I found a way to solve the problem using the JavaScript / Flash approach. If Flash compiles in the Local Only sandbox, it has full access to local files. Using ExternalInterface, JavaScript can request the Flash application to download the file, and Flash can pass the result back to JavaScript.

You can find my implementation here: https://code.google.com/p/flash-loader/

+1
May 10 '11 at 1:32 a.m.
source share

The trick that yelled for me is that you should specify the absolute path of the file, not just the file name in your HTML code. for example file: // ... instead of a direct name, even if you are accessing a file in the same directory. He will work!

-one
Jun 08 '11 at 10:11
source share



All Articles