How to set the –allow-file-access-from-files flag option in Google Chrome on the Windows 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. Fortunately, this can be bypassed by enabling the –allow-file-access-from-files flag option on the Windows Operating System. Here are the step-by-step instructions.
Step by Step Instructions
Via Command Line
First, make sure all Chrome processes are not running, you can use ‘taskkill’ command to make sure this is the case.
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>
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’ (note the single – ahead of allow-file…).
Via Chrome Launcher
First, make sure all Chrome processes are not running using Task Manager
- Press Control + Alt + Delete on your keyboard
- Choose to run Task Manager.
- Find any instances of Chrome that are running, you want to force quit them.
- 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. (here is a detailed step by step on how to create a windows shortcuts with parameters)
Once done, use the new launcher to start chrome each time you want the flag to exist.