Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 779
Panchotiya Vipul Avatar asked Sep 23 '13 04:09

Panchotiya Vipul


People also ask

Is JavaScript automatically enabled in Chrome?

On Google Chrome, JavaScript is enabled by default, but you can verify if it works through the Settings menu. To reveal the Settings menu, simply click on three tiny black dots at the top-right corner of your Chrome window.

Why is JavaScript not working in Chrome?

Google ChromeIn the "Settings" section click on the "Show advanced settings..." Under the the "Privacy" click on the "Content settings...". When the dialog window opens, look for the "JavaScript" section and select "Allow all sites to run JavaScript (recommended)". Click on the "OK" button to close it.


2 Answers

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.

like image 151
Satyam Koyani Avatar answered Oct 17 '22 07:10

Satyam Koyani


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>
like image 22
Uooo Avatar answered Oct 17 '22 06:10

Uooo