MCPcopy Index your code
hub / github.com/codeaashu/claude-code / getAllBrowserDataPaths

Function getAllBrowserDataPaths

src/utils/claudeInChrome/common.ts:232–275  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

230 * Get all browser data paths to check for extension installation
231 */
232export function getAllBrowserDataPaths(): {
233 browser: ChromiumBrowser
234 path: string
235}[] {
236 const platform = getPlatform()
237 const home = homedir()
238 const paths: { browser: ChromiumBrowser; path: string }[] = []
239
240 for (const browserId of BROWSER_DETECTION_ORDER) {
241 const config = CHROMIUM_BROWSERS[browserId]
242 let dataPath: string[] | undefined
243
244 switch (platform) {
245 case 'macos':
246 dataPath = config.macos.dataPath
247 break
248 case 'linux':
249 case 'wsl':
250 dataPath = config.linux.dataPath
251 break
252 case 'windows': {
253 if (config.windows.dataPath.length > 0) {
254 const appDataBase = config.windows.useRoaming
255 ? join(home, 'AppData', 'Roaming')
256 : join(home, 'AppData', 'Local')
257 paths.push({
258 browser: browserId,
259 path: join(appDataBase, ...config.windows.dataPath),
260 })
261 }
262 continue
263 }
264 }
265
266 if (dataPath && dataPath.length > 0) {
267 paths.push({
268 browser: browserId,
269 path: join(home, ...dataPath),
270 })
271 }
272 }
273
274 return paths
275}
276
277/**
278 * Get native messaging host directories for all supported browsers

Callers 1

Calls 2

getPlatformFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected