Chromium/zh: Difference between revisions

Ardenet (talk | contribs)
Created page with "如果视频播放加速不起作用,请检查 $chrome_flags_link 中的相关标志,或使用 CLI 启用它们:"
Ardenet (talk | contribs)
Created page with "完整的政策列表可在 [$1 Chrome 企业政策列表和管理] 中找到。"
 
(9 intermediate revisions by the same user not shown)
Line 10: Line 10:
== 更新浏览器政策 ==
== 更新浏览器政策 ==


<div lang="en" dir="ltr" class="mw-content-ltr">
Chromium 中,可以通过 {{Ic|chrome://policy}} 访问政策设置。用户可以使用这些设置更改影响企业政策的各种功能,例如
In Chromium, policy settings are accessible via {{Ic|chrome://policy}}. They allow the user to change enterprise policies affecting things like
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
* 安装浏览器时自动创建 Web 应用
* 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!
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
完整的政策列表可在 [https://chromeenterprise.google/policies/ Chrome 企业政策列表和管理] 中找到。
A full list of policies can be found at [https://chromeenterprise.google/policies/ Chrome Enterprise Policy List & Management].
</div>


<span id="Natively_Supported_Policies"></span>
<span id="Natively_Supported_Policies"></span>
=== 原生支持的政策 ===
=== 原生支持的政策 ===


<div lang="en" dir="ltr" class="mw-content-ltr">
NixOS 默认提供了一些可以直接启用的政策,下面给出一个简单的示例来理解这些政策的实现方式。
By default NixOS provides a few policies that can be enabled directly, a simple example is given below to understand how these are implemented
</div>


<syntaxhighlight lang="nixos" line="1">  programs.chromium = {
<syntaxhighlight lang="nixos" line="1">  programs.chromium = {
Line 53: Line 45:
   };</syntaxhighlight>
   };</syntaxhighlight>


<div lang="en" dir="ltr" class="mw-content-ltr">
* {{Ic|homepageLocation}} 选项允许您设置主页打开的网站。
* {{Ic|homepageLocation}} option allows you to set the site that the homepage will open on
* {{Ic|extensions}} 允许您通过一个简单的扩展程序 ID 列表直接在浏览器中下载扩展程序。该列表可以从 [https://chromewebstore.google.com/ Chrome 网上应用商店] 获取,通过打开扩展程序页面并复制 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
** 列表中提供的 URL 是 Google 用于管理、检查和更新扩展程序的链接。
** The URL provided in the list is the link that is used by google for managing, checking and updating extensions
** 因此,只需放置扩展程序 ID 的方法即可工作,如下所示:{{Ic|"fnpbehpgglbfnpimkachnpnecjncndgm"}}
** So the method of just placing the extension ID can work like this: {{Ic|"fnpbehpgglbfnpimkachnpnecjncndgm"}}
** 但以防该方法无法自动生效,上面显示了第二种方法,您需要放置 {{Ic|;}},然后放置 URL {{Ic|https //clients2.google.com/service/update2/crx}},以明确告诉 NixOS 从哪里安装扩展程序。
** 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
* 还有许多其他原生支持的选项,您可以通过 {{Ic|man configuration.nix}} 了解它们。
* There are many more options that are natively supported and you can learn about them through {{Ic|man configuration.nix}}
* 但如上所示,还有一个 {{Ic|extraOpts}} 选项,用于不支持直接设置的政策,例如安装网络应用程序的政策。
* 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
</div>


<span id="Non-natively_Supported_Policies"></span>
<span id="Non-natively_Supported_Policies"></span>
=== 非原生支持的政策 ===
=== 非原生支持的政策 ===


<div lang="en" dir="ltr" class="mw-content-ltr">
基于 Chromium 的浏览器中存在数百种政策,但并非所有政策都有直接的设置方法。{{Ic|extraOpts}} 选项允许声明所有其他政策。
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.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
虽然没有一个地方可以找到所有 Chromium 政策,但以下是一些可以查找的地方;
There is no single place to find all Chromium policies, but these are some places to look;
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
* 常用策略已在 {{Ic|programs.chromium}} 下的 {{Ic|man configuration.nix}} 中列出并记录。
* 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.
* 您可以导航至 {{Ic|chrome://policy}} 并启用“显示未设置值的政策(Show policies with no value set)”以查看所有可用键。点击政策名称即可查看其具体定义和使用详情。
* 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.]
 
</div>
* Chromium 的最新策略可在该[https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/pref_names.h 源码]中找到。


<span id="Accelerated_video_playback"></span>
<span id="Accelerated_video_playback"></span>
Line 102: Line 88:
</nowiki>}}
</nowiki>}}


<div lang="en" dir="ltr" class="mw-content-ltr">
在某些情况下,{{ic|chrome://gpu}} 将显示“视频解码(Video Decode)”已启用,但“视频加速信息(Video Acceleration Information)”为空,此时 {{ic|chrome://media-internals}} 使用的是 FFmpeg 视频解码器(软件解码)。如果出现这种情况,请尝试启用以下功能:
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:
</div>


{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
Line 122: Line 106:
</nowiki>}}
</nowiki>}}


<div lang="en" dir="ltr" class="mw-content-ltr">
<span id="Enabling_native_Wayland_support"></span>
== Enabling native Wayland support ==
== 启用原生 Wayland 支持 ==
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
您可以通过将 `NIXOS_OZONE_WL` 环境变量设置为 `1`,在所有基于 Chromium 的应用程序和大多数 Electron 应用程序中启用原生 Wayland 支持。
You can enable native Wayland support in all Chromium based and most Electron apps by setting the `NIXOS_OZONE_WL` environment variable to `1`.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<span id="Enabling_DRM_(Widevine_support)"></span>
== Enabling DRM (Widevine support) ==
== 启用 DRM(Widevine 支持)==
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
默认情况下,{{nixos:package|chromium}} 不支持播放受 DRM 保护的媒体。但是,可以通过构建时标志来包含来自 Nixpkgs 的专有 Widevine blob
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:
</div>


{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
Line 146: Line 124:
</nowiki>}}
</nowiki>}}


<div lang="en" dir="ltr" class="mw-content-ltr">
<span id="KeePassXC_support_in_Flatpak"></span>
== KeePassXC support in Flatpak ==
== Flatpak 中的 KeePassXC 支持 ==
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
要在 Flatpak 环境下运行 KeePassXC 和基于 Chromium 的浏览器时启用浏览器集成,请配置以下文件系统访问权限:
To enable browser integration between KeePassXC and Chromium-based browsers when running in Flatpak, configure the following filesystem access:
</div>


<syntaxhighlight lang="toml"># NativeMessagingHost directory (browser-specific)
<syntaxhighlight lang="toml"># NativeMessagingHost directory (browser-specific)
Line 167: Line 142:
</syntaxhighlight>
</syntaxhighlight>


<div lang="en" dir="ltr" class="mw-content-ltr">
<span id="Using_libc_memory_allocator"></span>
== Using libc memory allocator ==
== 使用 libc 内存分配器 ==
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
当使用诸如 scudo 之类的其他系统级内存分配器时,Chromium 可能无法正常工作。要在 Chromium 上使用 libc,需要以下 firejail 封装:
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:
</div>


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">