feat: 绕过 Claude Code 内的 claude 的账号需要; 但是浏览器扩展还是要权限

This commit is contained in:
claude-code-best
2026-04-03 23:57:27 +08:00
parent 6738a76152
commit 4c0b2aaedb
5 changed files with 6 additions and 13 deletions

View File

@@ -415,7 +415,7 @@ const getWorkflowCommands = feature('WORKFLOW_SCRIPTS')
* so this must be re-evaluated on every getCommands() call. * so this must be re-evaluated on every getCommands() call.
*/ */
export function meetsAvailabilityRequirement(cmd: Command): boolean { export function meetsAvailabilityRequirement(cmd: Command): boolean {
if (!cmd.availability) return true if (!cmd.availability || cmd.availability.length === 0) return true
for (const a of cmd.availability) { for (const a of cmd.availability) {
switch (a) { switch (a) {
case 'claude-ai': case 'claude-ai':

View File

@@ -186,7 +186,7 @@ function ClaudeInChromeMenu(t0) {
} else { } else {
options = $[8]; options = $[8];
} }
const isDisabled = isWSL || true && !isClaudeAISubscriber; const isDisabled = isWSL;
let t5; let t5;
if ($[18] !== onDone) { if ($[18] !== onDone) {
t5 = () => onDone(); t5 = () => onDone();
@@ -212,7 +212,7 @@ function ClaudeInChromeMenu(t0) {
} }
let t8; let t8;
if ($[23] !== isClaudeAISubscriber) { if ($[23] !== isClaudeAISubscriber) {
t8 = true && !isClaudeAISubscriber && <Text color="error">Claude in Chrome requires a claude.ai subscription.</Text>; t8 = false;
$[23] = isClaudeAISubscriber; $[23] = isClaudeAISubscriber;
$[24] = t8; $[24] = t8;
} else { } else {

View File

@@ -4,7 +4,7 @@ import type { Command } from '../../commands.js'
const command: Command = { const command: Command = {
name: 'chrome', name: 'chrome',
description: 'Claude in Chrome (Beta) settings', description: 'Claude in Chrome (Beta) settings',
availability: ['claude-ai'], availability: [],
isEnabled: () => !getIsNonInteractiveSession(), isEnabled: () => !getIsNonInteractiveSession(),
type: 'local-jsx', type: 'local-jsx',
load: () => import('./chrome.js'), load: () => import('./chrome.js'),

View File

@@ -21,14 +21,7 @@ async function _temp() {
if (!shouldEnableClaudeInChrome(chromeFlag)) { if (!shouldEnableClaudeInChrome(chromeFlag)) {
return null; return null;
} }
if (true && !isClaudeAISubscriber()) { // Subscription check bypassed
return {
key: "chrome-requires-subscription",
jsx: <Text color="error">Claude in Chrome requires a claude.ai subscription</Text>,
priority: "immediate",
timeoutMs: 5000
};
}
const installed = await isChromeExtensionInstalled(); const installed = await isChromeExtensionInstalled();
if (!installed && !isRunningOnHomespace()) { if (!installed && !isRunningOnHomespace()) {
return { return {

View File

@@ -1525,7 +1525,7 @@ async function run(): Promise<CommanderCommand> {
}; };
// Store the explicit CLI flag so teammates can inherit it // Store the explicit CLI flag so teammates can inherit it
setChromeFlagOverride(chromeOpts.chrome); setChromeFlagOverride(chromeOpts.chrome);
const enableClaudeInChrome = shouldEnableClaudeInChrome(chromeOpts.chrome) && ((process.env.USER_TYPE) === 'ant' || isClaudeAISubscriber()); const enableClaudeInChrome = shouldEnableClaudeInChrome(chromeOpts.chrome);
const autoEnableClaudeInChrome = !enableClaudeInChrome && shouldAutoEnableClaudeInChrome(); const autoEnableClaudeInChrome = !enableClaudeInChrome && shouldAutoEnableClaudeInChrome();
if (enableClaudeInChrome) { if (enableClaudeInChrome) {
const platform = getPlatform(); const platform = getPlatform();