claude-chrome-android 1.5.1 → 1.7.0

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.
@@ -380,6 +380,9 @@
380
380
  <span id="btn-update-text">Check for Update</span>
381
381
  </button>
382
382
  </div>
383
+ <div class="btn-row" style="margin-top:6px">
384
+ <button class="btn" id="btn-zap" style="flex:1" title="Tap an element on the page to remove it (overlays, popups, paywalls)">&#9889; Zap Element</button>
385
+ </div>
383
386
  <div class="section-title" style="margin-top:12px">Memory</div>
384
387
  <label style="display:flex;align-items:center;gap:8px;padding:8px 10px;background:#161b22;border:1px solid #21262d;border-radius:6px;cursor:pointer;font-size:12px">
385
388
  <input type="checkbox" id="chk-inject-all" style="accent-color:#58a6ff">
@@ -387,6 +390,16 @@
387
390
  <span style="flex:1"></span>
388
391
  <span style="font-size:10px;color:#8b949e" id="inject-mode-label">on-demand</span>
389
392
  </label>
393
+ <div class="section-title" style="margin-top:12px">Daemon Token</div>
394
+ <div style="padding:8px 10px;background:#161b22;border:1px solid #21262d;border-radius:6px">
395
+ <input type="password" id="operad-token" class="panel-filter" style="width:100%"
396
+ placeholder="Paste output of: operad token" autocomplete="off">
397
+ <div style="font-size:10px;color:#8b949e;margin-top:6px">
398
+ Needed to auto-start the bridge via the operad daemon (its API requires
399
+ <span style="font-family:monospace">Authorization: Bearer</span> since operad added auth).
400
+ <span id="operad-token-status" style="font-family:monospace"></span>
401
+ </div>
402
+ </div>
390
403
  </div>
391
404
 
392
405
  <!-- Tests panel -->
@@ -109,6 +109,22 @@ chrome.runtime.onMessage.addListener((msg) => {
109
109
 
110
110
  // --- Dashboard buttons -------------------------------------------------------
111
111
 
112
+ document.getElementById("btn-zap").addEventListener("click", () => {
113
+ const zapBtn = document.getElementById("btn-zap");
114
+ zapBtn.textContent = "Starting zapper...";
115
+ zapBtn.disabled = true;
116
+ chrome.runtime.sendMessage({ type: "start_zapper" }, (response) => {
117
+ if (response && response.ok !== false) {
118
+ // Close the popup so the user can tap the page element immediately
119
+ window.close();
120
+ } else {
121
+ zapBtn.textContent = "Zapper failed: " + (response?.error || "unknown");
122
+ zapBtn.disabled = false;
123
+ setTimeout(() => { zapBtn.innerHTML = "&#9889; Zap Element"; }, 3000);
124
+ }
125
+ });
126
+ });
127
+
112
128
  document.getElementById("btn-reconnect").addEventListener("click", () => {
113
129
  chrome.runtime.sendMessage({ type: "reconnect" }, () => {
114
130
  document.getElementById("statusText").textContent = "Reconnecting...";
@@ -116,54 +132,16 @@ document.getElementById("btn-reconnect").addEventListener("click", () => {
116
132
  });
117
133
  });
118
134
 
119
- document.getElementById("btn-launch-bridge").addEventListener("click", async () => {
120
- const launchBtn = document.getElementById("btn-launch-bridge");
121
- launchBtn.textContent = "Starting...";
122
- launchBtn.disabled = true;
123
-
124
- // Tier 1 & 2: Try daemon API + TermuxService (handled in background.js launchBridge)
125
- const response = await new Promise((resolve) => {
126
- chrome.runtime.sendMessage({ type: "launch_bridge" }, (r) => resolve(r));
127
- });
128
-
129
- if (response?.ok && response.method !== "needs_deeplink") {
130
- // Daemon or TermuxService handled it
131
- launchBtn.textContent = `Starting via ${response.method}...`;
132
- setTimeout(() => {
133
- launchBtn.disabled = false;
134
- launchBtn.textContent = "Launch Bridge";
135
- }, 5000);
136
- return;
137
- }
138
-
139
- // Tier 3: Try navigator.share() directly from popup context
140
- try {
141
- await navigator.share({
142
- title: "Start CFC Bridge",
143
- text: "termux-start-bridge",
144
- url: "https://termux.party/start-bridge",
145
- });
146
- // Share completed — user chose Termux
147
- launchBtn.textContent = "Waiting for bridge...";
148
- chrome.runtime.sendMessage({ type: "bridge_launch_initiated" });
149
- setTimeout(() => {
150
- launchBtn.disabled = false;
151
- launchBtn.textContent = "Launch Bridge";
152
- }, 12000);
153
- return;
154
- } catch {
155
- // navigator.share() failed or was cancelled — fall through to tier 4
156
- }
157
-
158
- // Tier 4: Last resort — open launcher page in active tab
159
- launchBtn.disabled = false;
160
- launchBtn.textContent = "Launch Bridge";
161
- chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => {
162
- if (tabs[0]) {
163
- chrome.tabs.update(tabs[0].id, { url: chrome.runtime.getURL("launcher.html") });
164
- } else {
165
- chrome.tabs.create({ url: chrome.runtime.getURL("launcher.html") });
135
+ document.getElementById("btn-launch-bridge").addEventListener("click", () => {
136
+ // Use a persistent tab: daemon requests can outlive the popup and consume the
137
+ // user-activation window required by navigator.share(). The launcher gives
138
+ // the fallback its own fresh tap and never replaces the user's current page.
139
+ chrome.tabs.create({ url: chrome.runtime.getURL("launcher.html") }, () => {
140
+ if (chrome.runtime.lastError) {
141
+ document.getElementById("statusText").textContent = chrome.runtime.lastError.message;
142
+ return;
166
143
  }
144
+ window.close();
167
145
  });
168
146
  });
169
147
 
@@ -275,6 +253,32 @@ chkInjectAll.addEventListener("change", () => {
275
253
  injectModeLabel.textContent = mode;
276
254
  });
277
255
 
256
+ // --- Operad daemon token -----------------------------------------------------
257
+ // The operad dashboard API requires Authorization: Bearer <token> (operad
258
+ // commit c3e71ce6). Stored here; background.js/launcher.js attach it when
259
+ // calling the daemon's /api/bridge endpoints to auto-start the bridge.
260
+
261
+ const tokenInput = document.getElementById("operad-token");
262
+ const tokenStatus = document.getElementById("operad-token-status");
263
+
264
+ chrome.storage.local.get("operadToken", (data) => {
265
+ if (data.operadToken) {
266
+ tokenInput.value = data.operadToken;
267
+ tokenStatus.textContent = "(saved)";
268
+ }
269
+ });
270
+
271
+ tokenInput.addEventListener("change", () => {
272
+ const token = tokenInput.value.trim();
273
+ if (token) {
274
+ chrome.storage.local.set({ operadToken: token });
275
+ tokenStatus.textContent = "(saved)";
276
+ } else {
277
+ chrome.storage.local.remove("operadToken");
278
+ tokenStatus.textContent = "(cleared)";
279
+ }
280
+ });
281
+
278
282
  // Also update from state pushes
279
283
  function updateInjectionMode(state) {
280
284
  if (state.cfcInjectionMode) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "claude-chrome-android",
3
- "version": "1.5.1",
4
- "description": "Claude Code Browser Bridge for Android — connects Claude Code CLI to Chrome/Edge via WebSocket",
3
+ "version": "1.7.0",
4
+ "description": "Claude Code Browser Bridge for Android \u2014 connects Claude Code CLI to Chrome/Edge via WebSocket",
5
5
  "author": "willstone",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -19,12 +19,17 @@
19
19
  ],
20
20
  "scripts": {
21
21
  "build": "node build.cjs",
22
- "pub": "bash publish.sh"
22
+ "pub": "bash publish.sh",
23
+ "typecheck": "tsc --noEmit -p tsconfig.json"
23
24
  },
24
25
  "devDependencies": {
26
+ "@anthropic-ai/claude-code": "*",
27
+ "@types/bun": "1.4.3",
28
+ "@types/node": "26.6.5",
29
+ "@types/ws": "8.18.2",
25
30
  "esbuild": "^0.24.0",
26
- "ws": "^8.18.0",
27
- "@anthropic-ai/claude-code": "*"
31
+ "typescript": "^5.9.3",
32
+ "ws": "^8.18.0"
28
33
  },
29
34
  "keywords": [
30
35
  "claude",