I am trying to edit Chrome's preferences using command line. The file is a JSON file and I want to edit the data below:

```
{"browser":{"last_redirect_origin":""}}

```

to

```
{"browser":{"enabled_labs_experiments":["ssl-version-max@2"],"last_redirect_origin":""}}

```

I was using sed command earlier to accomplish this but want to know how this can be done using python. This was the command I was using:

```
sed -i '.bak' -e 's|\(\"browser\"\):{\(\".*origin\":\"\"\)}|\1:{\"enabled_labs_experiments\":[\"ssl-version-max@2\"],\2}|' ~/Library/Application\ Support/Google/Chrome/Local\ State

```

The reason I can't use `jq` is that it is not native to macs and will need installation. I am not able to understand how to do this with python.

I will really appreciate it if someone could help me with this or point me in the right direction.

**EDIT**

This is what my python script looks like:

```
import json
jsonData = json.loads(open('/Users/username/Library/Application Support/Google/Chrome/Local state').read())
if 'enabled_labs_experiments' in jsonData['browser']:
    if 'ssl-version-max@2' in jsonData['browser']['enabled_labs_experiments']:
        print('Exist')
    else:
        jsonData['browser']['enabled_labs_experiments'] = ['ssl-version-max@2']
        print('Added')

```

After the changes are made, I would like to commit the changes to the file.