Chromium: Difference between revisions

added a new section that describes how to change policies for the chromium browser through the configuration.nix file and also provided external links for further documentation and reference that cannot be provided here
Ardenet (talk | contribs)
m Adjust the position of page translation tags
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<languages/>
<translate>
== Installation ==
== Installation ==
=== NixOS ===
=== NixOS ===
Add {{nixos:package|chromium}} to {{NixOS Manual|name=systemPackages|anchor=#sec-package-management}}.
Add {{nixos:package|chromium}} to {{NixOS Manual|name=systemPackages|anchor=#sec-package-management}}.


== Updating browser policies ==
== Updating browser policies ==
In Chromium the policy settings, which can be accessed by using {{Ic|chrome://policy}}, allow the user to change a lot of settings that dont exist anywhere else such as
In Chromium the policy settings, which can be accessed by using {{Ic|chrome://policy}}, allow the user to change a lot of settings that dont exist anywhere else such as


Line 14: Line 20:


=== Natively Supported Policies ===
=== 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<syntaxhighlight lang="nixos" line="1">programs.chromium = {
 
        enable = true;
By default NixOS provides a few policies that can be enabled directly, a simple example is given below to understand how these are implemented
homepageLocation = "https://www.startpage.com/";
 
extensions = [
</translate>
"eimadpbcbfnmbkopoojfekhnkhdbieeh;https://clients2.google.com/service/update2/crx" # dark reader
<syntaxhighlight lang="nixos" line="1"> programs.chromium = {
"aapbdbdomjkkjkaonfhkkikfgjllcleb;https://clients2.google.com/service/update2/crx" # google translate
    enable = true;
];
    homepageLocation = "https://www.startpage.com/";
extraOpts = {
    extensions = [
"WebAppInstallForceList" = [
      "eimadpbcbfnmbkopoojfekhnkhdbieeh;https://clients2.google.com/service/update2/crx" # dark reader
{
      "aapbdbdomjkkjkaonfhkkikfgjllcleb;https://clients2.google.com/service/update2/crx" # google translate
"custom_name" = "Youtube";
    ];
"create_desktop_shortcut" = false;
    extraOpts = {
"default_launch_container" = "window";
      "WebAppInstallForceList" = [
"url" = "https://youtube.com";
        {
}
          "custom_name" = "Youtube";
};
          "create_desktop_shortcut" = false;
};</syntaxhighlight>
          "default_launch_container" = "window";
          "url" = "https://youtube.com";
        }
      ];
    };
  };</syntaxhighlight>
<translate>


* {{Ic|homepageLocation}} option allows you to set the site that the homepage will open on
* {{Ic|homepageLocation}} option allows you to set the site that the homepage will open on
Line 42: Line 54:


=== Non-natively Supported Policies ===
=== Non-natively Supported Policies ===
As stated beforehand, there are hundreds of policies that are in chromium based browsers and not all of them can be supported directly and so the {{Ic|extraOpts}} option allows for the declaration of all the other policies
As stated beforehand, there are hundreds of policies that are in chromium based browsers and not all of them can be supported directly and so the {{Ic|extraOpts}} option allows for the declaration of all the other policies


Line 51: Line 64:
* To see the most up-to-date file on all policies you can go [https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/pref_names.h here]
* To see the most up-to-date file on all policies you can go [https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/pref_names.h here]


== Accelerated video playback ==  
== Accelerated video playback ==


Make sure [[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 cli:
If accelerated video playback is not working, check relevant flags at {{ic|chrome://flags}}, or enable them using the cli:
</translate>
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{
{
Line 69: Line 86:
}
}
</nowiki>}}
</nowiki>}}
<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 FFmpeg Video Decoder (software decoding). If this happens, try to enable the following features:
</translate>
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{
{
Line 86: Line 106:
}
}
</nowiki>}}
</nowiki>}}
<translate>


== Enabling native Wayland support ==
== Enabling native Wayland support ==
Line 92: Line 113:


== Enabling ManifestV2 support ==
== Enabling ManifestV2 support ==
To enable manifest v2 support <code>ExtensionManifestV2Availability</code> can be set to <code>2</code>.<ref>https://chromeenterprise.google/policies/#ExtensionManifestV2Availability</ref>{{file|/etc/nixos/configuration.nix|nix|<nowiki>
 
To enable manifest v2 support <code>ExtensionManifestV2Availability</code> can be set to <code>2</code>.<ref>https://chromeenterprise.google/policies/#ExtensionManifestV2Availability</ref>
 
</translate>
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{
{
   programs.chromium = {
   programs.chromium = {
Line 101: Line 126:
}
}
</nowiki>}}
</nowiki>}}
<translate>


== 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 unfree Widevine blob from nixpkgs:
By default, {{nixos:package|chromium}} does not support playing DRM protected media. However, there is a build time flag to include the unfree Widevine blob from nixpkgs:
</translate>
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{
{
Line 111: Line 140:
}
}
</nowiki>}}
</nowiki>}}
<translate>


== KeePassXC support in Flatpak ==
== KeePassXC support in Flatpak ==
To enable browser integration between KeePassXC and Chromium-based browsers when running in Flatpak, configure the following filesystem access:<syntaxhighlight lang="toml"># NativeMessagingHost directory (browser-specific)
 
To enable browser integration between KeePassXC and Chromium-based browsers when running in Flatpak, configure the following filesystem access:
 
</translate>
<syntaxhighlight lang="toml"># NativeMessagingHost directory (browser-specific)
# Brave Browser
# Brave Browser
xdg-config/BraveSoftware/Brave-Browser/NativeMessagingHosts:ro
xdg-config/BraveSoftware/Brave-Browser/NativeMessagingHosts:ro
Line 124: Line 158:
xdg-run/app/org.keepassxc.KeePassXC/org.keepassxc.KeePassXC.BrowserServer
xdg-run/app/org.keepassxc.KeePassXC/org.keepassxc.KeePassXC.BrowserServer
/nix/store:ro</syntaxhighlight>
/nix/store:ro</syntaxhighlight>
<translate>


== Using libc memory allocator ==
== 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:<syntaxhighlight lang="nix">
 
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:
 
</translate>
<syntaxhighlight lang="nix">
programs.firejail = {
programs.firejail = {
   enable = true;
   enable = true;
Line 141: Line 180:


</syntaxhighlight>
</syntaxhighlight>
[[Category:Applications]]
[[Category:Applications]]
[[Category:Web Browser]]
[[Category:Web Browser{{#translation:}}]]