浏览器配置/Firefox 浏览器集成插件

From KDE Wiki Sandbox
This page is a translated version of the page Browser Configuration/Firefox Dialog Integration and the translation is 83% complete.
Other languages:
从 Firefox 64 开始,Firefox 现在可以显示 Plasma 原生的“打开”和“保存”对话框,从而更好地与 Plasma 桌面的外观集成。

Template:警告 要启用本机对话框:

  • 安装必要的库。 在大多数发行版上,这可以通过安装 xdg-desktop-portal 来完成。 它们可能被分成两个独立的包(xdg-desktop-portalxdg-desktop-portal-kde)。
  • 复制 Firefox 桌面文件:
    cp /usr/share/applications/firefox.desktop $HOME/.local/share/applications
    如果需要对所有用户启用此功能 ,则必须以具有root权限的用户身份修改系统范围的快捷方式
  • Using the kwriteconfig tool in a console window (or a text editor), modify the Exec directives to instruct Firefox to use the Portal functionality.
    kwriteconfig5 --file $HOME/.local/share/applications/firefox.desktop --group "Desktop Entry" --key "Exec" "GTK_USE_PORTAL=1 /usr/lib/firefox/firefox %u"
    kwriteconfig5 --file $HOME/.local/share/applications/firefox.desktop --group "Desktop Action new-window" --key "Exec" "GTK_USE_PORTAL=1 /usr/lib/firefox/firefox --new-window %u"
    kwriteconfig5 --file $HOME/.local/share/applications/firefox.desktop --group "Desktop Action new-private-window" --key "Exec" "GTK_USE_PORTAL=1 /usr/lib/firefox/firefox --private-window %u"
    
Warning
Changing all "Exec" directives is required as Firefox can be started in multiple modes.