How to set the allow-file-access-from-files flag option in Google Chrome on the Linux Operating System

When developing and testing your applications, the problem is that browsers have security restrictions against running files like an HTML files or JavaScript from local files in Google Chrome. Fortunately, this can be bypassed by enabling the –allow-file-access-from-files flag option on the Linux Operating System. Here are the step-by-step instructions.

Step by Step Instructions

Via Command Line

  1. First, make sure all Chrome processes are not running; you can use ‘kill’ command to make sure this is the case.
  2. Next get the url of your Chrome Installation path to your chrome installation e.g C:\Users-your-user-name\AppData\Local\Google\Chrome\Application>
  3. Launch the Google Chrome browser from the command line window with the additional argument ‘–-allow-file-access-from-files’. E.g ‘path to your chrome installation\chrome.exe –allow-file-access-from-files’

Via Chrome Launcher

First, make sure all Chrome processes are not running using Task Manager

  1. Press Control + Alt + Delete on your keyboard
  2. Choose to run Task Manager.
  3. Find any instances of Chrome that are running, you want to force quit them.
  4. Click End task.

Copy the existing Chrome launcher.

Give it a new name e.g chrome – testing and modify the target by adding the parameter at the end.

Once done, use the new launcher to start chrome each time you want the flag to exist.