13

If you want to allow a local file to access a local file in google chrome you go to the terminal and run

$ google-chrome --allow-file-access-from-files 
0

3 Answers 3

12

Navigate to the desktop launcher / menu entry, open the launcher properties dialog for google chrome.

It should look like this:

/usr/bin/google-chrome %U

To make the flags that you want permanent, modify it to something like:

/usr/bin/google-chrome --allow-file-access-from-files

You may also need to delete and re-pin your icon launchers after modifying it. Chrome should launch with the specified flags enabled after the modification.

Alternatively, you can simply create a new launcher with the above and use it to start chrome.

To check if the flags that you modified are being loaded:

$ cat ~/.config/google-chrome/Local\ State

and scroll up to the block entitled

"session_restore"

Your flags should be listed in the block, before

--flag-switches-begin --flag-switches-end.

Opening chrome and navigating to the URL

chrome://version/

should also list enabled flags in the

Command Line 

block

This is a list of the google-chrome / chromium flags:

http://peter.sh/experiments/chromium-command-line-switches/

3
  • 1
    @Sam, you should remove How can I make that option always be turned on when ever google chrome is executed beyond running a .desktop every time part from your question as it will create confusion.
    – Web-E
    Oct 15, 2012 at 6:38
  • @Web-E Okay sounds good. Nov 30, 2012 at 2:21
  • Install menulibre as a way to get to the "launcher".
    – Rick James
    May 26, 2021 at 19:00
3

The different modes like --allow-file-access-from-files are flags/switches and not meant for general users. So you can't change them permanently with regular builds. The purpose of these switches/argument is to provide choice. These flags are neither supported nor recommended and must be used as temporary.

Since you don't want to use .desktop file or changing any shortcut. The only thing you can do is to look into code of open source chromium.

Customize the code and build it. Then only it will open with your desired mode.

List of switches | Source

1
  • That is what I feared. I'll just use the .desktop. Jul 6, 2012 at 22:49
1

Google-chrome and Chromium should function the same, the differences are pretty minor except for multimedia (especially Flash) and some file/folder locations (chromium instead of google-chrome) see http://code.google.com/p/chromium/wiki/ChromiumBrowserVsGoogleChrome

You should check out https://wiki.archlinux.org/index.php/Chromium_Tips_and_Tweaks especially:

Making it all persistent

You can export your flags from ~/.profile:
export CHROMIUM_USER_FLAGS="--disk-cache-dir=/tmp --disk-cache-size=50000000"

Or add them to /etc/chromium/default:
# Default settings for chromium. This file is sourced by /usr/bin/chromium
#
# Options to pass to chromium
CHROMIUM_FLAGS="--scroll-pixels=200"

Chromium will prefer the user defined flags in CHROMIUM_USER_FLAGS to those defined in
/etc/chromium/default. 
1
  • This is the only thing that's worked for me so far - adding CHROME_USER_FLAGS= to /etc/skel/.bashrc when the laptop is built May 20, 2019 at 15:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .