mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-11 13:51:10 -07:00
Feat/browser privacy consent (#21119)
This commit is contained in:
@@ -23,6 +23,7 @@ import type { Tool as McpTool } from '@modelcontextprotocol/sdk/types.js';
|
||||
import { debugLogger } from '../../utils/debugLogger.js';
|
||||
import type { Config } from '../../config/config.js';
|
||||
import { Storage } from '../../config/storage.js';
|
||||
import { getBrowserConsentIfNeeded } from '../../utils/browserConsent.js';
|
||||
import { injectInputBlocker } from './inputBlocker.js';
|
||||
import * as path from 'node:path';
|
||||
import * as fs from 'node:fs';
|
||||
@@ -260,6 +261,16 @@ export class BrowserManager {
|
||||
if (this.rawMcpClient) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Request browser consent if needed (first-run privacy notice)
|
||||
const consentGranted = await getBrowserConsentIfNeeded();
|
||||
if (!consentGranted) {
|
||||
throw new Error(
|
||||
'Browser agent requires user consent to proceed. ' +
|
||||
'Please re-run and accept the privacy notice.',
|
||||
);
|
||||
}
|
||||
|
||||
await this.connectMcp();
|
||||
}
|
||||
|
||||
@@ -352,6 +363,11 @@ export class BrowserManager {
|
||||
mcpArgs.push('--userDataDir', defaultProfilePath);
|
||||
}
|
||||
|
||||
// Respect the user's privacy.usageStatisticsEnabled setting
|
||||
if (!this.config.getUsageStatisticsEnabled()) {
|
||||
mcpArgs.push('--no-usage-statistics', '--no-performance-crux');
|
||||
}
|
||||
|
||||
if (
|
||||
browserConfig.customConfig.allowedDomains &&
|
||||
browserConfig.customConfig.allowedDomains.length > 0
|
||||
|
||||
Reference in New Issue
Block a user