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

Function shouldEnableClaudeInChrome

src/utils/claudeInChrome/setup.ts:39–68  ·  view source on GitHub ↗
(chromeFlag?: boolean)

Source from the content-addressed store, hash-verified

37const NATIVE_HOST_MANIFEST_NAME = `${NATIVE_HOST_IDENTIFIER}.json`
38
39export function shouldEnableClaudeInChrome(chromeFlag?: boolean): boolean {
40 // Disable by default in non-interactive sessions (e.g., SDK, CI)
41 if (getIsNonInteractiveSession() && chromeFlag !== true) {
42 return false
43 }
44
45 // Check CLI flags
46 if (chromeFlag === true) {
47 return true
48 }
49 if (chromeFlag === false) {
50 return false
51 }
52
53 // Check environment variables
54 if (isEnvTruthy(process.env.CLAUDE_CODE_ENABLE_CFC)) {
55 return true
56 }
57 if (isEnvDefinedFalsy(process.env.CLAUDE_CODE_ENABLE_CFC)) {
58 return false
59 }
60
61 // Check default config settings
62 const config = getGlobalConfig()
63 if (config.claudeInChromeDefaultEnabled !== undefined) {
64 return config.claudeInChromeDefaultEnabled
65 }
66
67 return false
68}
69
70let shouldAutoEnable: boolean | undefined = undefined
71

Callers 2

runFunction · 0.85
_tempFunction · 0.85

Calls 4

isEnvTruthyFunction · 0.85
isEnvDefinedFalsyFunction · 0.85
getGlobalConfigFunction · 0.85

Tested by

no test coverage detected