gemini-proxy-client 1.0.15 → 1.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/manager.js +4 -0
- package/dist/cli.js +7 -1
- package/package.json +1 -1
package/dist/browser/manager.js
CHANGED
|
@@ -33,6 +33,10 @@ export class BrowserManager {
|
|
|
33
33
|
console.log(chalk.gray(`指纹配置: ${fingerprint.viewport.width}x${fingerprint.viewport.height}, ${fingerprint.locale}, ${fingerprint.timezoneId}`));
|
|
34
34
|
this.browser = await Camoufox({
|
|
35
35
|
headless: this.options.headless,
|
|
36
|
+
// 禁用 Cross-Origin-Opener-Policy,允许操作跨域 iframe 中的元素
|
|
37
|
+
disable_coop: true,
|
|
38
|
+
// 允许在主世界执行脚本,用于 iframe 内的 evaluate
|
|
39
|
+
main_world_eval: true,
|
|
36
40
|
});
|
|
37
41
|
this.context = await this.browser.newContext({
|
|
38
42
|
viewport: fingerprint.viewport,
|
package/dist/cli.js
CHANGED
|
@@ -7,12 +7,18 @@ import fs from 'fs';
|
|
|
7
7
|
import { startClient } from './commands/start.js';
|
|
8
8
|
import { loginCommand } from './commands/login.js';
|
|
9
9
|
import { statusCommand } from './commands/status.js';
|
|
10
|
+
import { fileURLToPath } from 'url';
|
|
11
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
12
|
+
const __dirname = path.dirname(__filename);
|
|
13
|
+
// 从 package.json 读取版本号
|
|
14
|
+
const packageJsonPath = path.join(__dirname, '..', 'package.json');
|
|
15
|
+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
|
|
10
16
|
const DEFAULT_DATA_DIR = path.join(os.homedir(), '.gemini-client');
|
|
11
17
|
const program = new Command();
|
|
12
18
|
program
|
|
13
19
|
.name('gemini-client')
|
|
14
20
|
.description('Gemini Proxy Build App 客户端 - 使用 Camoufox 自动保持连接')
|
|
15
|
-
.version(
|
|
21
|
+
.version(packageJson.version);
|
|
16
22
|
program
|
|
17
23
|
.command('start')
|
|
18
24
|
.description('启动客户端,连接到代理服务器')
|