#1152975 chromium: /etc/chromium.d/extensions splits --load-extension when COLUMNS is set

Package:
chromium
Source:
chromium
Description:
web browser
Submitter:
Mitar
Date:
2026-11-03 21:35:02 UTC
Severity:
normal
Tags:
#1152975#5
Date:
2026-11-03 21:33:13 UTC
From:
To:
/etc/chromium.d/extensions builds the list of extensions to load with:

    export CHROMIUM_FLAGS="$CHROMIUM_FLAGS --load-extension=`ls -dm
/usr/share/chromium/extensions/* 2>/dev/null | tr -d '\n'`"

ls -m separates entries with ", " and wraps its output at 80 columns,
or at $COLUMNS when that is set. Where a line wraps, it ends with ","
and no space, so after tr -d '\n' those entries are joined by a plain
comma. Entries which share a line keep the ", " between them, and
/usr/bin/chromium expands $CHROMIUM_FLAGS unquoted (exec
$LIBDIR/$APPNAME $CHROMIUM_FLAGS "$@"), so the space splits the switch
into two arguments.

With the default width, the paths are long enough that every entry is
on a line of its own, unless the directory names are very short. With
COLUMNS in the environment Chromium is started from, for example from
a shell which exports it, the entries share a line. With
webext-ublock-origin-chromium and webext-vimium-chromium installed:

    $ COLUMNS=200 sh -c 'for arg in --load-extension=`ls -dm
/usr/share/chromium/extensions/* 2>/dev/null | tr -d "\n"`; do echo
"[$arg]"; done'
    [--load-extension=/usr/share/chromium/extensions/ublock-origin,]
    [/usr/share/chromium/extensions/vimium]

Chromium then loads only uBlock Origin, and receives the path of
Vimium as a separate argument, which it treats as something to open.
The same split also reaches --disable-extensions-except, which
/usr/bin/chromium derives from --load-extension when
--enable-remote-extensions is not set.

The patch below builds the list independently of the width: ls -d
prints one path per line into a pipe, and paste -sd, joins them with
plain commas. An empty directory still gives an empty value, as now.

    $ COLUMNS=200 sh -c 'for arg in --load-extension=`ls -d
/usr/share/chromium/extensions/* 2>/dev/null | paste -sd,`; do echo
"[$arg]"; done'
    [--load-extension=/usr/share/chromium/extensions/ublock-origin,/usr/share/chromium/extensions/vimium]

I noticed this on Ubuntu 26.04 with the xtradeb PPA's build of this
packaging (156.0.8078.73-1xtradeb1.2604.1), and debian/etc/extensions
is the same in current master on salsa.
--- a/debian/etc/extensions
+++ b/debian/etc/extensions
@@ -2,4 +2,4 @@
 export CHROMIUM_FLAGS="$CHROMIUM_FLAGS --enable-remote-extensions"

 # load all of the extensions installed to /usr/share/chromium/extensions
-export CHROMIUM_FLAGS="$CHROMIUM_FLAGS --load-extension=`ls -dm
/usr/share/chromium/extensions/* 2>/dev/null | tr -d '\n'`"
+export CHROMIUM_FLAGS="$CHROMIUM_FLAGS --load-extension=`ls -d
/usr/share/chromium/extensions/* 2>/dev/null | paste -sd,`"


Mitar