Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions extensions/browsers-profiles/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Raycast Browsers Profiles

## [Fix Chromium invalid profile names] - 2025-11-27

- Read chromium profiles from `Local State` file to get their custom names

## [Add Helium browser support] - 2025-11-27

- Adding Helium browser to supported browser list

## [Add sorting on profile names] - 2025-02-03

- Adding a simple sort on the profile names
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions extensions/browsers-profiles/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"author": "skydiver",
"contributors": [
"kytta",
"emilshr"
"emilshr",
"chingweih"
],
"scripts": {
"build": "ray build",
Expand Down Expand Up @@ -44,5 +45,8 @@
"mode": "view"
}
],
"title": "Open Browsers Profiles"
"title": "Open Browsers Profiles",
"platforms": [
"macOS"
]
}
44 changes: 29 additions & 15 deletions extensions/browsers-profiles/src/lib/chromium.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,29 +29,43 @@ export const getChromiumProfiles = () => {
return null;
}

const directories = fs.readdirSync(path);
const localStatePath = `${path}/Local State`;
const localStateExists = fs.existsSync(localStatePath);

const browserProfiles: ChromiumProfile[] = [];

directories.forEach((directory) => {
const preferences = `${path}/${directory}/Preferences`;
if (!localStateExists) {
return null;
}

if (directory === "System Profile" || !fs.existsSync(preferences)) {
return null;
}
let localState;
try {
const localStateFile = fs.readFileSync(localStatePath, "utf-8");
localState = JSON.parse(localStateFile);
} catch (error) {
return null;
}

const file = fs.readFileSync(preferences, "utf-8");
const profile = JSON.parse(file);
const infoCacheData = localState?.profile?.info_cache as
| Record<
string,
{
name: string;
}
>
| undefined;
if (!infoCacheData) {
return null;
}

browserProfiles.push({
const browserProfiles: ChromiumProfile[] = Object.entries(infoCacheData).map(
([profileDir, { name: profileName }]) => ({
type: browser.type,
browser: browser.title,
app: browser.app,
path: directory,
name: profile.profile.name,
path: profileDir,
name: profileName,
icon: browser.icon,
});
});
})
);

sortProfiles(browserProfiles);

Expand Down
7 changes: 7 additions & 0 deletions extensions/browsers-profiles/src/lib/supported-browsers.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@
"title": "Microsoft Edge Canary",
"path": "/Library/Application Support/Microsoft Edge Canary",
"icon": "edge-canary.png"
},
{
"app": "Helium",
"type": "CHROMIUM",
"title": "Helium",
"path": "/Library/Application Support/net.imput.helium",
"icon": "helium.png"
}
],
"firefox": [
Expand Down