How to enable google chrome chrome://flags/ values using javascript?

28,243

Solution 1

local state file contains setting of flags(This is text file in json format)

Chrome user directory location

"browser": {
      "enabled_labs_experiments": [ "load-cloud-policy-on-signin", "old-checkbox-style" ],
      "last_redirect_origin": ""
   }

"enabled_labs_experiments" attribute contains value of such flags which user enabled manually.In your case you have to first check your preferred flag entry is available or not if not then you have to add your flag in this file by javascript.

Using javascript you can read and edit text files so read that file from specified location as per operating system and edit that file.

Solution 2

Changing browser settings and options using Javascript is not possible. This can only be controlled by the user.

However, Chrome's experimental flags can be accessed using direct links. But note that

The feature is currently available in Chrome Canary, and maybe also in Chrome Dev. It may take a while before it makes its way to other versions of the browser.

Once it is available, you can use a link like this in your webpage to make it more convenient for the user to find the right setting:

<a href="chrome://flags/#disable-webrtc" target="_blank">Enable WEBRTC</a>
Share:
28,243

Related videos on Youtube

Panchotiya Vipul
Author by

Panchotiya Vipul

Software Engineer(JAVA) at Ahemedabad, India

Updated on September 23, 2020

Comments

  • Panchotiya Vipul
    Panchotiya Vipul about 3 years

    I want to enable google chrome flags enable using JavaScript.If flags enable then no action require, if disable then make it enable .

    enter image description here

  • sreekarun
    sreekarun about 10 years
    The direct link works when pasted on the browser navigation bar. but fails when linking through the page ( cannot access the local resource error )
  • Uooo
    Uooo about 10 years
    @sreekarun are you using Chrome Canary? As written, it is only available in Chrome Canary and maybe in Chrome Dev currently, not in the stable version.
  • Altanai
    Altanai almost 9 years
    attempt to read local file such as chrome's Local State results in "SecurityError"
  • thdoan
    thdoan about 7 years
    I'm using v53 beta and it still doesn't allow linking to chrome:// from an <a> element.

Related