The initial_preferences
json file can be used to configure the preferences that will be used by default in newly created profiles.
The Brave browser is reading initial_preferences
from /opt/brave.com/brave/initial_preferences
.
The Brave browser profile preferences are stored in ~/.config/BraveSoftware/Brave-Browser/Default/Preferences
json file. You can use it as as a base and modify it to your needs for its use as initial_preferences
file.
You can run Brave browser in some qube, configure all the settings that you want, convert the Preferences
json file to a readable format using this command:
python3 -m json.tool ~/.config/BraveSoftware/Brave-Browser/Default/Preferences > ~/initial_preferences
~/initial_preferences
file and remove all unnecessary settings from this file (timestamps, UUIDs, default settings etc) and then use this file for your disposables.
You can check if the resulting json file is valid by running this command:
python3 -m json.tool ~/initial_preferences > /dev/null
Once you've created your initial_preferences
file you can place it in disposable template:
Open terminal of disposable template for Brave browser.
Copy the initial_preferences
file to the disposable template.
Configure bind-dirs for initial_preferences file and copy the initial_preferences file to the right location by running these commands:
sudo mkdir -p /rw/config/qubes-bind-dirs.d
cat << 'EOF' | sudo tee -a /rw/config/qubes-bind-dirs.d/50_brave.conf > /dev/null
binds+=( '/opt/brave.com/brave/initial_preferences' )
EOF
sudo mkdir -p /rw/bind-dirs/opt/brave.com/brave
sudo cp /home/user/QubesIncoming/*/initial_preferences /rw/bind-dirs/opt/brave.com/brave/
initial_preferences
file location and browser-specific preferences will differ.
Example initial_preferences
config based on this recommended Brave configuration:
[details="initial_preferences"]
{
"brave": {
"brave_ads": {
"should_allow_ads_subdivision_targeting": false
},
"enable_media_router_on_restart": false,
"enable_window_closing_confirm": true,
"fb_embed_default": false,
"google_login_default": false,
"hangouts_enabled": false,
"ipfs": {
"resolve_method": 3
},
"new_tab_page": {
"hide_all_widgets": true,
"show_background_image": false,
"show_rewards": false,
"show_stats": false,
"show_together": false
},
"rewards": {
"badge_text": "",
"show_brave_rewards_button_in_location_bar": false
},
"today": {
"should_show_toolbar_button": false
},
"twitter_embed_default": false,
"wallet": {
"default_solana_wallet": 1,
"default_wallet2": 1,
"show_wallet_icon_on_toolbar": false
},
"webtorrent_enabled": false
},
"browser": {
"custom_chrome_frame": false,
"has_seen_welcome_page": true
},
"media_router": {
"enable_media_router": false
},
"ntp": {
"custom_background_inspiration": false,
"custom_background_local_to_device": false,
"shortcust_visible": false
},
"profile": {
"content_settings": {
"exceptions": {
"cosmeticFiltering": {
"*,*": {
"setting": 2
},
"*,https://firstparty": {
"setting": 2
}
},
"fingerprintingV2": {
"*,*": {
"setting": 2
}
},
"shieldsAds": {
"*,*": {
"setting": 2
}
},
"trackers": {
"*,*": {
"setting": 2
}
}
}
},
"default_content_setting_values": {
"brave_remember_1p_storage": 2,
"cookies": 4,
"httpsUpgrades": 2,
"javascript_jit": 2
}
},
"webrtc": {
"ip_handling_policy": "disable_non_proxied_udp"
}
}
[/details]