Skip to content

Commit 13abd46

Browse files
chingweihgreptile-apps[bot]raycastbot
authored
Update browsers-profiles extension (#23079)
* Update browsers-profiles extension - [Open Browser Profiles] chore: update changelog - [Open Browser Profiles] fix: fix `path` to only include profile directory name instead of full path so it can be opened - [Open Browser Profiles] feat: use `Local State` file for reading chromium profiles, fix invalid names (#16182) - [Open Browser Profiles] feat: add helium browser support (#21828) - Initial commit * Update extensions/browsers-profiles/src/lib/chromium.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * Update browsers-profiles extension - Merge branch \'contributions/merge-1763818810886\' - Pull contributions - Merge branch \'contributions/merge-1763818780819\' - Pull contributions - [Open Browser Profiles] fix: add error handling to JSON parse * chore: use type assertion * Update CHANGELOG.md, add platforms field and optimise images --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: raycastbot <[email protected]>
1 parent fd4349e commit 13abd46

File tree

5 files changed

+50
-17
lines changed

5 files changed

+50
-17
lines changed

extensions/browsers-profiles/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Raycast Browsers Profiles
22

3+
## [Fix Chromium invalid profile names] - 2025-11-27
4+
5+
- Read chromium profiles from `Local State` file to get their custom names
6+
7+
## [Add Helium browser support] - 2025-11-27
8+
9+
- Adding Helium browser to supported browser list
10+
311
## [Add sorting on profile names] - 2025-02-03
412

513
- Adding a simple sort on the profile names
2.33 KB
Loading

extensions/browsers-profiles/package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"author": "skydiver",
1111
"contributors": [
1212
"kytta",
13-
"emilshr"
13+
"emilshr",
14+
"chingweih"
1415
],
1516
"scripts": {
1617
"build": "ray build",
@@ -44,5 +45,8 @@
4445
"mode": "view"
4546
}
4647
],
47-
"title": "Open Browsers Profiles"
48+
"title": "Open Browsers Profiles",
49+
"platforms": [
50+
"macOS"
51+
]
4852
}

extensions/browsers-profiles/src/lib/chromium.ts

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,29 +29,43 @@ export const getChromiumProfiles = () => {
2929
return null;
3030
}
3131

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

34-
const browserProfiles: ChromiumProfile[] = [];
35-
36-
directories.forEach((directory) => {
37-
const preferences = `${path}/${directory}/Preferences`;
35+
if (!localStateExists) {
36+
return null;
37+
}
3838

39-
if (directory === "System Profile" || !fs.existsSync(preferences)) {
40-
return null;
41-
}
39+
let localState;
40+
try {
41+
const localStateFile = fs.readFileSync(localStatePath, "utf-8");
42+
localState = JSON.parse(localStateFile);
43+
} catch (error) {
44+
return null;
45+
}
4246

43-
const file = fs.readFileSync(preferences, "utf-8");
44-
const profile = JSON.parse(file);
47+
const infoCacheData = localState?.profile?.info_cache as
48+
| Record<
49+
string,
50+
{
51+
name: string;
52+
}
53+
>
54+
| undefined;
55+
if (!infoCacheData) {
56+
return null;
57+
}
4558

46-
browserProfiles.push({
59+
const browserProfiles: ChromiumProfile[] = Object.entries(infoCacheData).map(
60+
([profileDir, { name: profileName }]) => ({
4761
type: browser.type,
4862
browser: browser.title,
4963
app: browser.app,
50-
path: directory,
51-
name: profile.profile.name,
64+
path: profileDir,
65+
name: profileName,
5266
icon: browser.icon,
53-
});
54-
});
67+
})
68+
);
5569

5670
sortProfiles(browserProfiles);
5771

extensions/browsers-profiles/src/lib/supported-browsers.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@
5555
"title": "Microsoft Edge Canary",
5656
"path": "/Library/Application Support/Microsoft Edge Canary",
5757
"icon": "edge-canary.png"
58+
},
59+
{
60+
"app": "Helium",
61+
"type": "CHROMIUM",
62+
"title": "Helium",
63+
"path": "/Library/Application Support/net.imput.helium",
64+
"icon": "helium.png"
5865
}
5966
],
6067
"firefox": [

0 commit comments

Comments
 (0)