01 March 2010

Extra-hidden preferences for Google Chrome

Some time ago (months rather than weeks) I read a short but interesting article about setting a minimum font size in Chrome for Linux. It's a rather complicated trick, as it involves modifying a Chrome setup file manually, but unfortunately it's the only way to change this setting, since the browser doesn't have a user interface for it.

Looking at the code found in the file, I realized this is actually a WebKit-preference, meaning the trick can also be applied to Windows as well and most likely to Mac OS X, and not only to Chrome, but to Safari also. On Windows, the file named simply Preferences (without an extension) is located in the Default subfolder of the Chrome installation directory (on Windows XP it is C:\Documents and Settings\[User Name]\Local Settings\Application Data\Chromium\Application; on Vista/Windows 7 C:\Users\[User Name]\AppData\Local\Chromium\Application). You can edit it using any text editor, like Notepad. You should always back-up the file before making changes, because it contains many Chrome user preferences and you might want to restore it later. Also make sure Chrome isn't running while you are working on the file, because the program will overwrite your changes while closing.

I was curious to see if there are other Chrome features that can be controlled through these WebKit preferences and I found an interesting list in the Chromium source code. You can make some powerful changes here, most of which you can't access anywhere else:

  • You can disable JavaScript for the entire browser by setting the flag javascript_enabled to false or prevent JavaScript from opening windows with javascript_can_open_windows_automatically;
  • You can disable plug-ins like Flash or Gears by setting plugins_enabled to false or only Java with java_enabled;
  • You can turn off images by setting loads_images_automatically to false, but I wouldn't recommend it, the web looks so empty without them;
  • You can choose whether large pictures are displayed at full resolution or resized to fit the browser window by toggling shrinks_standalone_images_to_fit;
  • You can disable the rather useful ability to resize text boxes with the flag text_areas_are_resizable set to false.

As an example, the text in the file should look something like this in order for the changes to take effect, with the flag name between quotation marks, followed by a colon, the flag value and a comma at the end of the line:

"webprefs": {
"minimum_font_size": 14,
"minimum_logical_font_size": 14,
"text_areas_are_resizable": false }

This would make Chrome look like the picture at the left, compared to the default look at the right:

  • Google Chrome with modified WebKit preferences
    Google Chrome with minimum text size set to 14 and resizable text boxes turned off
  • Google Chrome default
    Google Chrome with default settings

Even if they could prove useful to some users, these flags are very difficult to use, even more difficult than the more well-known command line flags. If they won't be integrated in the standard user interface, and I don't expect them to be anytime soon, the only practical way to use them would be to have separate Chrome profiles for each combination the user needs.

2 comments:

  1. very cool. I've been using chrome more and more and with all these settings its getting easier to stop using FireFox. I found all the "about:" pages but some of them no longer work. At least not in OS X in the latest beta. Thanks for posting these.

    ReplyDelete
  2. In the newer versions of Chrome (4.1 and higher) controls in the user interface were introduced for some of these options, like blocking images or JavaScript, called "Content settings".

    ReplyDelete