Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

refactor(browser): skip locale reads for page-less extensions

AdityaUmalee2579426989d
diff --git a/server/browser/extensions.ts b/server/browser/extensions.ts
index bf6fec02b0..5e7bb66dab 100644
--- a/server/browser/extensions.ts
+++ b/server/browser/extensions.ts
@@ -72,9 +72,9 @@ export function installedExtensions(userDataDir: string): InstalledExtension[] {
const manifest = dir ? readJson(join(dir, "manifest.json")) : null;
if (!dir || !manifest) continue;
const page = pageOf(manifest);
+ if (!page) continue;
const name = text(manifest.name);
const shown = name ? localized(name, dir, manifest) : null;
- if (!page) continue;
const url = new URL(page, `chrome-extension://${id}/`).href;
if (extensionPage(url) && new URL(url).hostname === id) found.push({ id, name: (shown ?? id).slice(0, 120), url });
} catch {
diff --git a/server/browser/service.ts b/server/browser/service.ts
index 297a9c5f11..4730ffc17e 100644
--- a/server/browser/service.ts
+++ b/server/browser/service.ts
@@ -729,7 +729,7 @@ export class BrowserService {
profile.hub.tabsChanged();
},
download: (id: string): Download | undefined => profile.run?.browser.downloads?.list().find((download) => download.id === id),
- extensions: () => (profileKind(profile.key) === "mychrome" || profileKind(profile.key) === "cdp" ? [] : installedExtensions(profileDir(this.#options.dataDir, profile.key))),
+ extensions: () => (["mychrome", "cdp"].includes(profileKind(profile.key)) ? [] : installedExtensions(profileDir(this.#options.dataDir, profile.key))),
};
}
}