Skip to content

Commit f18c190

Browse files
kleberbaumnetsnek
authored andcommitted
Fix CORS proxy port, sandbox warning, update notification, missing statsigClientKey
- CORS proxy port now read from ?cors_port= URL param (was hardcoded 9080) - Suppress terminal sandbox AppArmor notification (no helper binary in serve-web) - Suppress "New update available" banner (not applicable for serve-web/RPM) - Ensure statsigClientKey in product.json (needed for feature flags/model loading) - Bump layout fix version to clear stale localStorage
1 parent ced477b commit f18c190

File tree

5 files changed

+28
-7
lines changed

5 files changed

+28
-7
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,14 @@ cursor-web [port] [cors-port]
140140
cursor-web 8080 9080 # defaults
141141
```
142142

143-
Then open `http://localhost:8080` in your browser. The full desktop workbench loads with all Cursor AI features:
143+
Then open the URL shown in the terminal (includes `?cors_port=` parameter). The full desktop workbench loads with all Cursor AI features:
144144
- **Composer** — multi-file AI editing
145145
- **Agent mode** — autonomous coding agent
146146
- **Chat** — AI chat panel
147147
- **CursorTab** — AI autocomplete
148148
- **Model selection** — choose between Claude, GPT-4, etc.
149149

150-
Open a specific folder: `http://localhost:8080/?folder=/path/to/project`
150+
Open a specific folder: `http://localhost:8080/?cors_port=9080&folder=/path/to/project`
151151

152152
Install as a PWA via your browser's "Install" menu for a native app experience.
153153

@@ -192,6 +192,8 @@ The patch script (`patch-cursor-web.sh`) applies these modifications to make the
192192
| 7o. migrate_editor_mode | Disable Statsig gate that forces Agent mode on every load |
193193
| 7p. Onboarding Ic() | Disable Agent mode force in onboarding callback |
194194
| 7q. Onboarding render | Skip onboarding walkthrough entirely (forces Agent mode on completion) |
195+
| 7r. Sandbox notification | Suppress terminal sandbox AppArmor warning (no sandbox helper in serve-web) |
196+
| 7s. Update notification | Suppress "New update available" banner (auto-update N/A for serve-web/RPM) |
195197

196198
### Server JS (`server-main.js`)
197199
| Patch | Description |

build-cursor-arm64.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,9 @@ d['extensionsGallery'] = {
153153
# Disable telemetry
154154
d['enableTelemetry'] = False
155155
d['enabledTelemetryLevels'] = {'error': False, 'usage': False}
156-
# Keep statsigClientKey — Statsig feature flags are needed for model loading
157-
# d.pop('statsigClientKey', None)
156+
# Ensure statsigClientKey is present — Statsig feature flags are needed for model loading
157+
if 'statsigClientKey' not in d:
158+
d['statsigClientKey'] = 'client-Bm4HJ0aDjXHQVsoACMREyLNxm5p6zzuzhO50MgtoT5D'
158159
d.pop('statsigLogEventProxyUrl', None) # Disable event logging proxy only
159160
d.pop('crashReporterId', None)
160161
d.pop('appInsightsConnectionString', None)

cursor-web.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fi
2121

2222
echo "==> Starting Cursor Web on port $PORT..."
2323
echo " CORS proxy on port $CORS_PORT"
24-
echo " Open http://localhost:$PORT in your browser"
24+
echo " Open http://localhost:$PORT/?cors_port=$CORS_PORT in your browser"
2525
echo " Install as PWA: Browser menu → Install Cursor..."
2626
echo ""
2727

patch-cursor-web.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,24 @@ if old in js:
444444
elif new in js and 'sC_' in js:
445445
print(' sC_ onboarding already patched')
446446
447+
# 7r. Suppress terminal sandbox AppArmor notification (always fires on Linux >= 6.2 without sandbox helper)
448+
old = '!this._rawSandboxSupported&&e?.linuxKernelVersion?this._showSandboxUnsupportedNotification(e.linuxKernelVersion)'
449+
new = '!this._rawSandboxSupported&&e?.linuxKernelVersion?void 0'
450+
if old in js:
451+
js = js.replace(old, new, 1)
452+
changed = True
453+
print(' sandbox AppArmor notification suppressed')
454+
elif new in js:
455+
print(' sandbox notification already suppressed')
456+
457+
# 7s. Suppress "New update available" notification (auto-update not applicable for serve-web/RPM)
458+
old = 'minor-version-notification-text>New update available'
459+
new = 'minor-version-notification-text>New update available" style="display:none'
460+
if old in js and 'style="display:none' not in js[js.find(old):js.find(old)+200] if old in js else True:
461+
js = js.replace(old, new, 1)
462+
changed = True
463+
print(' update notification suppressed')
464+
447465
if changed:
448466
open(f, 'w').write(js)
449467
PATCH_DESKTOP_EOF

workbench-desktop-shim.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// Intercept and route through local proxy.
99
{
1010
const _originalFetch = window.fetch;
11-
const PROXY_PORT = 9080;
11+
const PROXY_PORT = parseInt(new URLSearchParams(window.location.search).get('cors_port') || '9080', 10);
1212
// Match Cursor API endpoints + Statsig feature flag domains (CORS-blocked in browser)
1313
const _cursorApiRe = /https?:\/\/(?:[a-z0-9-]*\.?(?:api[2-5]\.cursor\.sh)|api\.statsigcdn\.com|featureassets\.org|prodregistryv2\.org|statsigapi\.net)/;
1414
// Rewrite vscode-remote:// URLs to local HTTP resource endpoint
@@ -689,7 +689,7 @@ async function seedAuthTokens() {
689689
}
690690
// One-time layout reset: undo damage from migrate_editor_mode migration
691691
// (now disabled via workbench patch 7o) and prevent onboarding from forcing Agent mode.
692-
const _layoutFixVersion = '7';
692+
const _layoutFixVersion = '8';
693693
const _layoutFixKey = _storagePrefix + 'cursorWeb/layoutFixApplied';
694694
if (localStorage.getItem(_layoutFixKey) !== _layoutFixVersion) {
695695
// Reset Agent mode hidden flags

0 commit comments

Comments
 (0)