~ruther/guix-local

ref: 64668f7c15fa639831209f25e313c99a1047de7b guix-local/gnu/packages/patches/ungoogled-chromium-extension-search-path.patch -rw-r--r-- 943 bytes
64668f7c — Rutherther etc: release: Add spare space to the release VM image. a month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Look for extensions in $CHROMIUM_EXTENSION_DIRECTORY instead of
/usr/share/chromium/extensions.

--- a/chrome/common/chrome_paths.cc
+++ b/chrome/common/chrome_paths.cc
@@ -6,6 +6,7 @@
 
 #include <optional>
 
+#include "base/environment.h"
 #include "base/files/file_path.h"
 #include "base/files/file_util.h"
 #include "base/no_destructor.h"
@@ -522,7 +523,13 @@
 #endif
 #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
     case chrome::DIR_STANDALONE_EXTERNAL_EXTENSIONS: {
-      cur = base::FilePath(kFilepathSinglePrefExtensions);
+      std::unique_ptr<base::Environment> environment(base::Environment::Create());
+      if (environment->GetVar("CHROMIUM_EXTENSION_DIRECTORY")) {
+        auto extension_dir = environment->GetVar("CHROMIUM_EXTENSION_DIRECTORY").value();
+        cur = base::FilePath(extension_dir);
+      } else {
+        cur = base::FilePath(kFilepathSinglePrefExtensions);
+      }
       break;
     }
 #endif