Chromium: Difference between revisions

Restructure, remove MV2 section and improve grammar
Ardenet (talk | contribs)
m Adjust the position of page translation tags and add tvar tags
Line 1: Line 1:
<languages/>
<languages/>
<translate>
<translate>
== Installation ==
== Installation ==


=== NixOS ===
=== NixOS ===


Add {{nixos:package|chromium}} to {{NixOS Manual|name=systemPackages|anchor=#sec-package-management}}.
Add <tvar name="chromium_package">{{nixos:package|chromium}}</tvar> to <tvar name="systemPackages">{{NixOS Manual|name=systemPackages|anchor=#sec-package-management}}</tvar>.


== Updating browser policies ==
== Updating browser policies ==


In Chromium, policy settings are accessible via {{Ic|chrome://policy}}. They allow the user to change enterprise policies affecting things like
In Chromium, policy settings are accessible via <tvar name="chrome_policy_link">{{Ic|chrome://policy}}</tvar>. 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 24: Line 23:


By default NixOS provides a few policies that can be enabled directly, a simple example is given below to understand how these are implemented
By default NixOS provides a few policies that can be enabled directly, a simple example is given below to understand how these are implemented
</translate>


</translate>
<syntaxhighlight lang="nixos" line="1">  programs.chromium = {
<syntaxhighlight lang="nixos" line="1">  programs.chromium = {
     enable = true;
     enable = true;
Line 44: Line 43:
     };
     };
   };</syntaxhighlight>
   };</syntaxhighlight>
<translate>
<translate>
 
* <tvar name="homepageLocation">{{Ic|homepageLocation}}</tvar> 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
* <tvar name="extensions">{{Ic|extensions}}</tvar> allows for the download of extensions directly in the browser through a simple list of the extension ID's that can be obtained from the [<tvar name="1">https://chromewebstore.google.com/</tvar> Chrome Web Store] by opening an extension page and copying the last part of the URL
* {{Ic|extensions}} allows for the download of extensions directly in the browser through a simple list of the extension ID's that can be obtained from the [https://chromewebstore.google.com/ 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
** 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
** 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: {{Ic|"fnpbehpgglbfnpimkachnpnecjncndgm"}}
** So the method of just placing the extension ID can work like this: <tvar name="ext_id">{{Ic|"fnpbehpgglbfnpimkachnpnecjncndgm"}}</tvar>
** But just in case that method does not automatically function the second method is shown above, where you place {{Ic|;}} and then the URL {{Ic|https //clients2.google.com/service/update2/crx}} to explicitly tell NixOS where to install the extension from
** But just in case that method does not automatically function the second method is shown above, where you place <tvar name="symbol">{{Ic|;}}</tvar> and then the URL <tvar name="url">{{Ic|https //clients2.google.com/service/update2/crx}}</tvar> to 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 {{Ic|man configuration.nix}}
* There are many more options that are natively supported and you can learn about them through <tvar name="command">{{Ic|man configuration.nix}}</tvar>
* But as shown above there is also an {{Ic|extraOpts}} option and that is used for policies that are not supported for direct setup, such as the policy to install web-apps
* But as shown above there is also an <tvar name="extraOpts">{{Ic|extraOpts}}</tvar> option 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 ===
=== 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 are hundreds of policies in Chromium based browsers, and not all have direct methods to set them. The <tvar name="extraOpts">{{Ic|extraOpts}}</tvar> 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;
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}}.
* 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.
* You can navigate to <tvar name="chrome_policy_link">{{Ic|chrome://policy}}</tvar> 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.]
* The most up to date policies for Chromium are available in the [<tvar name="1">https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/pref_names.h</tvar> 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 [[<tvar name="1">Special:MyLanguage/Accelerated Video Playback</tvar>|Accelerated Video Playback]] is setup on the system properly. Check <tvar name="chrome_gpu_link">{{ic|chrome://gpu}}</tvar> 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 <tvar name="chrome_flags_link">{{ic|chrome://flags}}</tvar>, or enable them using the CLI:
</translate>


</translate>
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{
{
Line 85: Line 84:
}
}
</nowiki>}}
</nowiki>}}
<translate>
<translate>
In some cases, <tvar name="chrome_gpu_link">{{ic|chrome://gpu}}</tvar> will show Video Decode as enabled, but Video Acceleration Information as blank, with <tvar name="chrome_media_link">{{ic|chrome://media-internals}}</tvar> using the FFmpeg Video Decoder (software decoding). If this happens, try to enable the following features:
</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 the 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 105: Line 104:
}
}
</nowiki>}}
</nowiki>}}
<translate>
<translate>
== Enabling native Wayland support ==
== Enabling native Wayland support ==


Line 113: Line 112:
== 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 proprietary Widevine blob from Nixpkgs:
By default, <tvar name="chromium_package">{{nixos:package|chromium}}</tvar> does not support playing DRM protected media. However, there is a build time flag to include the proprietary Widevine blob from Nixpkgs:
</translate>


</translate>
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{
{
Line 123: Line 122:
}
}
</nowiki>}}
</nowiki>}}
<translate>
<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:
To enable browser integration between KeePassXC and Chromium-based browsers when running in Flatpak, configure the following filesystem access:
</translate>


</translate>
<syntaxhighlight lang="toml"># NativeMessagingHost directory (browser-specific)
<syntaxhighlight lang="toml"># NativeMessagingHost directory (browser-specific)
# Brave Browser
# Brave Browser
Line 140: Line 139:
# KeePassXC server socket and Nix store
# KeePassXC server socket and Nix store
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>
<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:
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>


</translate>
<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
programs.firejail = {
programs.firejail = {
Line 161: Line 161:
   };
   };
};
};
</syntaxhighlight>
</syntaxhighlight>


[[Category:Applications]]
[[Category:Applications]]
[[Category:Web Browser{{#translation:}}]]
[[Category:Web Browser{{#translation:}}]]