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

I want to enable google chrome flags using JavaScript. If the flags are enabled, then no action is required, if you disable it, then enable it.

enter image description here

+8
javascript google-chrome
source share
2 answers

the local state file contains the installation of flags (this is a 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" contains the value of such flags that the user activated manually. In your case, you must first check that the flag you selected is available, or not, if not, then you should add your flag to this javascript file.

Using javascript, you can read and edit text files to read this file from a specified location in accordance with the operating system and edit this file.

+9
source share

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

However, you can access the experimental Chrome flags using direct links . But keep in mind that

This feature is currently available in Chrome Canary as well as in Chrome Dev. This may take some time before it switches to other versions of the browser.

Once it is available, you can use the link on your web page to make it more convenient to find the correct setting:

 <a href="chrome://flags/#disable-webrtc" target="_blank">Enable WEBRTC</a> 
+4
source share

All Articles