fthx
December 19, 2025, 8:31pm
1
Hi all,
I just made Snap Menu GNOME extension.
https://extensions.gnome.org/extension/9040/snap-menu/
It uses snapd2 library and works quite well.
BUT I did not success to get channels. I get a void array with snap.get_channels() or an error with snap.channels.
_showSnapInfo(snap) {
this.menu?.close();
const title = snap?.title
const summary = snap?.summary ?? 'N/A';
const version = snap?.version ?? 'N/A';
const revision = snap?.revision ?? 'N/A';
const channel = snap?.channel ?? 'N/A';
const confinement = this._getSnapConfinementName(snap?.confinement) ?? 'N/A';
//const channels = snap?.channels?.map(channel => channel.name).join(' ') ?? 'N/A';
this._showTextDialog(
'Snap menu extension :: Info',
[
`<b>Name</b>\u2003${title}`,
`<b>Summary</b>\u2003${summary}`,
'',
`<b>Version</b>\u2003${version} (${revision})`,
`<b>Channel</b>\u2003${channel}`,
`<b>Confinement</b>\u2003${confinement}`,
I need help here as I do not understand how it works. I tried to get channels sync rather than async but the issue is the same.
I tried to make a dedicated function but same issue again:
_getSnapChannels(snap) {
this._snapdClient?.find_async(
Snapd.FindFlags.SCOPE_WIDE,
snap?.name,
null,
(client, result) => {
const storeSnap = client.find_finish(result);
log(storeSnap);
return storeSnap[0][0]?.channels;
}
);
Thanks!
Related: https://discourse.ubuntu.com/t/snap-gnome-extension/73774
fthx
December 25, 2025, 11:09am
2
https://api.snapcraft.io/v2/snaps/find?architecture=amd64&confinement=strict%2Cclassic&fields=base%2Cconfinement%2Clinks%2Ccontact%2Cdescription%2Cdownload%2Clicense%2Cprices%2Cprivate%2Cpublisher%2Crevision%2Csummary%2Ctitle%2Ctype%2Cversion%2Cwebsite%2Cstore-url%2Cmedia%2Ccommon-ids%2Ccategories%2Cchannel&q=gimp
returns:
{"error-list":[{"code":"missing-header","message":"Snap-Device-Series header is required."}]}
and I’m stuck here.
Why are you making the request to api.snapcraft.io ?
fthx
December 26, 2025, 12:24am
4
That’s the find_sync function.