Chromium: Difference between revisions
m Adjust the position of page translation tags |
Restructure, remove MV2 section and improve grammar |
||
| Line 10: | Line 10: | ||
== Updating browser policies == | == Updating browser policies == | ||
In Chromium | In Chromium, policy settings are accessible via {{Ic|chrome://policy}}. They allow the user to change enterprise policies affecting things like | ||
* Creating webapps when the browser is installed | * Creating webapps when the browser is installed | ||
| Line 17: | Line 17: | ||
* Disable screenshots to be taken with browser extensions | * Disable screenshots to be taken with browser extensions | ||
* Block all downloads from the browser (if you want to do that for some reason) | * Block all downloads from the browser (if you want to do that for some reason) | ||
* and | * and more! | ||
A full list of policies can be found at [https://chromeenterprise.google/policies/ Chrome Enterprise Policy List & Management]. | |||
=== Natively Supported Policies === | === Natively Supported Policies === | ||
| Line 55: | Line 57: | ||
=== Non-natively Supported Policies === | === Non-natively Supported Policies === | ||
There are hundreds of policies in Chromium based browsers, and not all have direct methods to set them. The {{Ic|extraOpts}} option allows for the declaration of all the other policies. | |||
There is no | There is no single place to find all Chromium policies, but these are some places to look; | ||
* | * Commonly used policies are present and documented within {{Ic|man configuration.nix}} under {{Ic|programs.chromium}}. | ||
* | * You can navigate to {{Ic|chrome://policy}} and enable "Show policies with no value set" to see all available keys. Clicking a policy name opens its specific definition and usage details. | ||
* The most up to date policies for Chromium are available in the [https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/pref_names.h source code.] | |||
* | |||
== Accelerated video playback == | == Accelerated video playback == | ||
Make sure [[Special:MyLanguage/Accelerated Video Playback|Accelerated Video Playback]] is setup on the system properly. Check {{ic|chrome://gpu}} to see if Chromium has enabled hardware acceleration. | Make sure [[Special:MyLanguage/Accelerated Video Playback|Accelerated Video Playback]] is setup on the system properly. Check {{ic|chrome://gpu}} to see if Chromium has enabled hardware acceleration. | ||
If accelerated video playback is not working, check relevant flags at {{ic|chrome://flags}}, or enable them using the | If accelerated video playback is not working, check relevant flags at {{ic|chrome://flags}}, or enable them using the CLI: | ||
</translate> | </translate> | ||
| Line 88: | Line 87: | ||
<translate> | <translate> | ||
In some cases, {{ic|chrome://gpu}} will show Video Decode as enabled, but Video Acceleration Information as blank, with {{ic|chrome://media-internals}} using FFmpeg Video Decoder (software decoding). If this happens, try to enable the following features: | In some cases, {{ic|chrome://gpu}} will show Video Decode as enabled, but Video Acceleration Information as blank, with {{ic|chrome://media-internals}} using the FFmpeg Video Decoder (software decoding). If this happens, try to enable the following features: | ||
</translate> | </translate> | ||
| Line 110: | Line 109: | ||
== Enabling native Wayland support == | == Enabling native Wayland support == | ||
You can | You can enable native Wayland support in all Chromium based and most Electron apps by setting the `NIXOS_OZONE_WL` environment variable to `1`. | ||
== Enabling DRM (Widevine support) == | == Enabling DRM (Widevine support) == | ||
By default, {{nixos:package|chromium}} does not support playing DRM protected media. However, there is a build time flag to include the | By default, {{nixos:package|chromium}} does not support playing DRM protected media. However, there is a build time flag to include the proprietary Widevine blob from Nixpkgs: | ||
</translate> | </translate> | ||
Latest revision as of 16:41, 10 May 2026
Installation
NixOS
Add chromium to
systemPackages.
Updating browser policies
In Chromium, policy settings are accessible via chrome://policy. They allow the user to change enterprise policies affecting things like
- Creating webapps when the browser is installed
- Finding and downloading browser extensions automatically
- Enabling or disabling the dinosaur game when the device is offline
- Disable screenshots to be taken with browser extensions
- Block all downloads from the browser (if you want to do that for some reason)
- and more!
A full list of policies can be found at Chrome Enterprise Policy List & Management.
Natively Supported Policies
By default NixOS provides a few policies that can be enabled directly, a simple example is given below to understand how these are implemented
programs.chromium = {
enable = true;
homepageLocation = "https://www.startpage.com/";
extensions = [
"eimadpbcbfnmbkopoojfekhnkhdbieeh;https://clients2.google.com/service/update2/crx" # dark reader
"aapbdbdomjkkjkaonfhkkikfgjllcleb;https://clients2.google.com/service/update2/crx" # google translate
];
extraOpts = {
"WebAppInstallForceList" = [
{
"custom_name" = "Youtube";
"create_desktop_shortcut" = false;
"default_launch_container" = "window";
"url" = "https://youtube.com";
}
];
};
};
homepageLocationoption allows you to set the site that the homepage will open onextensionsallows for the download of extensions directly in the browser through a simple list of the extension ID's that can be obtained from the Chrome Web Store by opening an extension page and copying the last part of the URL- In the example however there is another component, the download source from which the extensions will be downloaded
- The URL provided in the list is the link that is used by google for managing, checking and updating extensions
- So the method of just placing the extension ID can work like this:
"fnpbehpgglbfnpimkachnpnecjncndgm" - But just in case that method does not automatically function the second method is shown above, where you place
;and then the URLhttps //clients2.google.com/service/update2/crxto explicitly tell NixOS where to install the extension from
- There are many more options that are natively supported and you can learn about them through
man configuration.nix - But as shown above there is also an
extraOptsoption and that is used for policies that are not supported for direct setup, such as the policy to install web-apps
Non-natively Supported Policies
There are hundreds of policies in Chromium based browsers, and not all have direct methods to set them. The extraOpts option allows for the declaration of all the other policies.
There is no single place to find all Chromium policies, but these are some places to look;
- Commonly used policies are present and documented within
man configuration.nixunderprograms.chromium. - You can navigate to
chrome://policyand enable "Show policies with no value set" to see all available keys. Clicking a policy name opens its specific definition and usage details. - The most up to date policies for Chromium are available in the source code.
Accelerated video playback
Make sure Accelerated Video Playback is setup on the system properly. Check chrome://gpu to see if Chromium has enabled hardware acceleration.
If accelerated video playback is not working, check relevant flags at chrome://flags, or enable them using the CLI:
{
environment.systemPackages = with pkgs; [
(chromium.override {
commandLineArgs = [
"--enable-features=AcceleratedVideoEncoder"
"--ignore-gpu-blocklist"
"--enable-zero-copy"
];
})
];
}
In some cases, chrome://gpu will show Video Decode as enabled, but Video Acceleration Information as blank, with chrome://media-internals using the FFmpeg Video Decoder (software decoding). If this happens, try to enable the following features:
{
environment.systemPackages = with pkgs; [
(chromium.override {
commandLineArgs = [
"--enable-features=AcceleratedVideoEncoder,VaapiOnNvidiaGPUs,VaapiIgnoreDriverChecks,Vulkan,DefaultANGLEVulkan,VulkanFromANGLE"
"--enable-features=VaapiIgnoreDriverChecks,VaapiVideoDecoder,PlatformHEVCDecoderSupport"
"--enable-features=UseMultiPlaneFormatForHardwareVideo"
"--ignore-gpu-blocklist"
"--enable-zero-copy"
];
})
];
}
Enabling native Wayland support
You can enable native Wayland support in all Chromium based and most Electron apps by setting the `NIXOS_OZONE_WL` environment variable to `1`.
Enabling DRM (Widevine support)
By default, chromium does not support playing DRM protected media. However, there is a build time flag to include the proprietary Widevine blob from Nixpkgs:
{
environment.systemPackages = with pkgs; [
(chromium.override { enableWideVine = true; })
];
}
KeePassXC support in Flatpak
To enable browser integration between KeePassXC and Chromium-based browsers when running in Flatpak, configure the following filesystem access:
# NativeMessagingHost directory (browser-specific)
# Brave Browser
xdg-config/BraveSoftware/Brave-Browser/NativeMessagingHosts:ro
# Chromium
xdg-config/chromium/NativeMessagingHosts:ro
# Google Chrome
xdg-config/google-chrome/NativeMessagingHosts:ro
# KeePassXC server socket and Nix store
xdg-run/app/org.keepassxc.KeePassXC/org.keepassxc.KeePassXC.BrowserServer
/nix/store:ro
Using libc memory allocator
Chromium may not work when an alternative system-wide memory allocator like scudo is used. To use libc on Chromium, the following firejail wrap is required:
programs.firejail = {
enable = true;
wrappedBinaries = {
chromium = {
executable = "${pkgs.chromium}/bin/chromium-browser";
profile = "${pkgs.firejail}/etc/firejail/chromium-browser.profile";
extraArgs = [
"--blacklist=/etc/ld-nix.so.preload"
];
};
};
};