@lightcone-ai/daemon 0.9.15 → 0.9.16

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/xhs-login.js +8 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightcone-ai/daemon",
3
- "version": "0.9.15",
3
+ "version": "0.9.16",
4
4
  "type": "module",
5
5
  "main": "src/index.js",
6
6
  "bin": {
package/src/xhs-login.js CHANGED
@@ -69,6 +69,10 @@ export class XhsLoginSession {
69
69
  '--headless=new',
70
70
  `--user-data-dir=${this._profileDir}`,
71
71
  '--window-size=800,900',
72
+ '--disable-blink-features=AutomationControlled',
73
+ '--disable-infobars',
74
+ '--excludeSwitches=enable-automation',
75
+ '--user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
72
76
  'about:blank',
73
77
  ], {
74
78
  stdio: 'ignore',
@@ -108,6 +112,10 @@ export class XhsLoginSession {
108
112
 
109
113
  await this.send('Page.enable', {});
110
114
  await this.send('Network.enable', {});
115
+ // Hide automation fingerprint
116
+ await this.send('Page.addScriptToEvaluateOnNewDocument', {
117
+ source: `Object.defineProperty(navigator, 'webdriver', { get: () => undefined });`,
118
+ });
111
119
  await this.send('Page.navigate', { url: 'https://www.xiaohongshu.com' });
112
120
 
113
121
  // Start sending screenshots and checking login