claude-chrome-android 1.3.0 → 1.4.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.
- package/dist/claude-code-bridge.crx +0 -0
- package/dist/cli.js +201 -157
- package/dist/edge-claude-ext/background.js +1492 -0
- package/dist/edge-claude-ext/content.js +1044 -0
- package/dist/edge-claude-ext/icon128.png +0 -0
- package/dist/edge-claude-ext/icon16.png +0 -0
- package/dist/edge-claude-ext/icon48.png +0 -0
- package/dist/edge-claude-ext/launcher.html +63 -0
- package/dist/edge-claude-ext/launcher.js +98 -0
- package/dist/edge-claude-ext/manifest.json +35 -0
- package/dist/edge-claude-ext/popup.html +444 -0
- package/dist/edge-claude-ext/popup.js +637 -0
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>Launch Bridge</title>
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<style>
|
|
7
|
+
body {
|
|
8
|
+
font-family: system-ui, -apple-system, sans-serif;
|
|
9
|
+
background: #0d1117; color: #e6edf3;
|
|
10
|
+
display: flex; flex-direction: column;
|
|
11
|
+
align-items: center; justify-content: center;
|
|
12
|
+
height: 100vh; margin: 0; padding: 20px;
|
|
13
|
+
text-align: center;
|
|
14
|
+
}
|
|
15
|
+
.card {
|
|
16
|
+
background: #161b22; padding: 24px; border-radius: 12px;
|
|
17
|
+
border: 1px solid #30363d; max-width: 360px; width: 100%;
|
|
18
|
+
}
|
|
19
|
+
h2 { margin-top: 0; font-size: 18px; }
|
|
20
|
+
p { color: #8b949e; font-size: 13px; margin-bottom: 20px; }
|
|
21
|
+
button {
|
|
22
|
+
background: #238636; color: #fff; border: none;
|
|
23
|
+
padding: 14px 24px; border-radius: 8px;
|
|
24
|
+
font-size: 16px; font-weight: 600;
|
|
25
|
+
cursor: pointer; width: 100%;
|
|
26
|
+
}
|
|
27
|
+
button:active { background: #2ea043; }
|
|
28
|
+
#status { color: #8b949e; font-size: 12px; margin-top: 12px; min-height: 16px; }
|
|
29
|
+
.setup-hint {
|
|
30
|
+
margin-top: 16px; padding: 12px;
|
|
31
|
+
background: #0d1117; border-radius: 8px;
|
|
32
|
+
border: 1px solid #30363d;
|
|
33
|
+
text-align: left; font-size: 12px;
|
|
34
|
+
color: #8b949e;
|
|
35
|
+
}
|
|
36
|
+
.setup-hint code {
|
|
37
|
+
display: block; margin: 6px 0;
|
|
38
|
+
padding: 6px 8px; background: #161b22;
|
|
39
|
+
border-radius: 4px; color: #7ee787;
|
|
40
|
+
font-family: 'Cascadia Code', 'Fira Code', monospace;
|
|
41
|
+
font-size: 11px; word-break: break-all;
|
|
42
|
+
-webkit-user-select: all; user-select: all;
|
|
43
|
+
}
|
|
44
|
+
.setup-hint strong { color: #e6edf3; }
|
|
45
|
+
</style>
|
|
46
|
+
</head>
|
|
47
|
+
<body>
|
|
48
|
+
<div class="card">
|
|
49
|
+
<h2>Launch CFC Bridge</h2>
|
|
50
|
+
<p>Tries the daemon API first. Falls back to share-to-Termux if the daemon is not running.</p>
|
|
51
|
+
<button id="share-btn">Share to Termux</button>
|
|
52
|
+
<div id="status"></div>
|
|
53
|
+
<div class="setup-hint" id="setup-hint">
|
|
54
|
+
<strong>First time?</strong> Run in Termux:
|
|
55
|
+
<code>npx claude-chrome-android --setup</code>
|
|
56
|
+
This creates the URL handler so the share button works.
|
|
57
|
+
Or start the bridge directly:
|
|
58
|
+
<code>npx claude-chrome-android</code>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
<script src="launcher.js"></script>
|
|
62
|
+
</body>
|
|
63
|
+
</html>
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// Launch bridge — tries daemon API first, falls back to navigator.share() → Termux.
|
|
2
|
+
// Browser intent: URIs add CATEGORY_BROWSABLE which Termux doesn't declare,
|
|
3
|
+
// so navigator.share() (native OS share, no BROWSABLE) is the only path
|
|
4
|
+
// when the daemon isn't running.
|
|
5
|
+
|
|
6
|
+
const btn = document.getElementById("share-btn");
|
|
7
|
+
const status = document.getElementById("status");
|
|
8
|
+
const setupHint = document.getElementById("setup-hint");
|
|
9
|
+
|
|
10
|
+
// Listen for state updates from background.js (single source of truth for polling)
|
|
11
|
+
chrome.runtime.onMessage.addListener((msg) => {
|
|
12
|
+
if (msg.type === "state_update") {
|
|
13
|
+
if (msg.state === "connected") {
|
|
14
|
+
status.textContent = "Bridge connected";
|
|
15
|
+
// Auto-close launcher tab after successful connection
|
|
16
|
+
setTimeout(() => window.close(), 1000);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
// On load: try daemon API first — may start bridge without share sheet
|
|
22
|
+
(async () => {
|
|
23
|
+
// Check if already connected
|
|
24
|
+
chrome.runtime.sendMessage({ type: "get_state" }, (resp) => {
|
|
25
|
+
if (resp?.state === "connected") {
|
|
26
|
+
status.textContent = "Bridge is already connected";
|
|
27
|
+
btn.textContent = "Already Running";
|
|
28
|
+
btn.disabled = true;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
// Try starting via daemon HTTP API (works when Termux is running)
|
|
33
|
+
status.textContent = "Trying daemon...";
|
|
34
|
+
try {
|
|
35
|
+
const ctrl = new AbortController();
|
|
36
|
+
const timer = setTimeout(() => ctrl.abort(), 3000);
|
|
37
|
+
const resp = await fetch("http://127.0.0.1:18970/api/bridge", {
|
|
38
|
+
method: "POST",
|
|
39
|
+
signal: ctrl.signal,
|
|
40
|
+
});
|
|
41
|
+
clearTimeout(timer);
|
|
42
|
+
if (resp.ok) {
|
|
43
|
+
const data = await resp.json();
|
|
44
|
+
if (data.status === "starting" || data.status === "already_running") {
|
|
45
|
+
status.textContent = `Bridge ${data.status} via daemon — waiting for connection...`;
|
|
46
|
+
btn.textContent = "Starting...";
|
|
47
|
+
btn.disabled = true;
|
|
48
|
+
// Tell background to start polling
|
|
49
|
+
chrome.runtime.sendMessage({ type: "bridge_launch_initiated" });
|
|
50
|
+
// Auto-close timeout
|
|
51
|
+
setTimeout(() => {
|
|
52
|
+
if (status.textContent.includes("waiting")) {
|
|
53
|
+
status.textContent = "Bridge didn't respond — try share button below";
|
|
54
|
+
btn.textContent = "Share to Termux";
|
|
55
|
+
btn.disabled = false;
|
|
56
|
+
}
|
|
57
|
+
}, 12000);
|
|
58
|
+
return; // Daemon handled it
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
} catch {
|
|
62
|
+
// Daemon not reachable — Termux may not be running
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Daemon didn't work — show share button
|
|
66
|
+
status.textContent = "Tap below to share to Termux and start the bridge";
|
|
67
|
+
})();
|
|
68
|
+
|
|
69
|
+
btn.addEventListener("click", async () => {
|
|
70
|
+
btn.textContent = "Opening share sheet...";
|
|
71
|
+
btn.disabled = true;
|
|
72
|
+
|
|
73
|
+
try {
|
|
74
|
+
await navigator.share({ text: "https://cfcbridge.example.com/start" });
|
|
75
|
+
// User picked a target (hopefully Termux)
|
|
76
|
+
status.textContent = "Shared — waiting for bridge to start...";
|
|
77
|
+
btn.textContent = "Share to Termux";
|
|
78
|
+
btn.disabled = false;
|
|
79
|
+
|
|
80
|
+
// Notify background.js to start polling (it's the single source of truth)
|
|
81
|
+
chrome.runtime.sendMessage({ type: "bridge_launch_initiated" });
|
|
82
|
+
|
|
83
|
+
// Simple local timeout — background handles the actual polling
|
|
84
|
+
setTimeout(() => {
|
|
85
|
+
if (status.textContent.includes("waiting")) {
|
|
86
|
+
status.textContent = "Bridge didn't start — try again or start manually in Termux";
|
|
87
|
+
}
|
|
88
|
+
}, 15000);
|
|
89
|
+
} catch (e) {
|
|
90
|
+
btn.textContent = "Share to Termux";
|
|
91
|
+
btn.disabled = false;
|
|
92
|
+
if (e.name === "AbortError") {
|
|
93
|
+
status.textContent = "Cancelled — tap to try again";
|
|
94
|
+
} else {
|
|
95
|
+
status.textContent = "Error: " + e.message;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"manifest_version": 2,
|
|
3
|
+
"name": "Claude Code Browser Bridge",
|
|
4
|
+
"version": "1.11.1",
|
|
5
|
+
"description": "Bridges Claude Code CLI to Edge Android via WebSocket",
|
|
6
|
+
"permissions": [
|
|
7
|
+
"activeTab",
|
|
8
|
+
"tabs",
|
|
9
|
+
"webRequest",
|
|
10
|
+
"cookies",
|
|
11
|
+
"storage",
|
|
12
|
+
"<all_urls>"
|
|
13
|
+
],
|
|
14
|
+
"background": {
|
|
15
|
+
"scripts": ["background.js"],
|
|
16
|
+
"persistent": true
|
|
17
|
+
},
|
|
18
|
+
"content_scripts": [
|
|
19
|
+
{
|
|
20
|
+
"matches": ["http://127.0.0.1/*", "http://localhost/*"],
|
|
21
|
+
"js": ["content.js"],
|
|
22
|
+
"run_at": "document_idle",
|
|
23
|
+
"all_frames": false
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"browser_action": {
|
|
27
|
+
"default_popup": "popup.html",
|
|
28
|
+
"default_title": "Claude Code Bridge"
|
|
29
|
+
},
|
|
30
|
+
"icons": {
|
|
31
|
+
"16": "icon16.png",
|
|
32
|
+
"48": "icon48.png",
|
|
33
|
+
"128": "icon128.png"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,444 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<style>
|
|
7
|
+
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
8
|
+
body {
|
|
9
|
+
width: 360px;
|
|
10
|
+
max-height: 580px;
|
|
11
|
+
overflow-y: auto;
|
|
12
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
|
|
13
|
+
background: #0d1117;
|
|
14
|
+
color: #c9d1d9;
|
|
15
|
+
font-size: 13px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* Header */
|
|
19
|
+
.header {
|
|
20
|
+
padding: 14px 16px;
|
|
21
|
+
background: linear-gradient(135deg, #161b22, #1c2333);
|
|
22
|
+
border-bottom: 1px solid #21262d;
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
gap: 10px;
|
|
26
|
+
position: sticky;
|
|
27
|
+
top: 0;
|
|
28
|
+
z-index: 10;
|
|
29
|
+
}
|
|
30
|
+
.header-icon {
|
|
31
|
+
width: 32px; height: 32px;
|
|
32
|
+
border-radius: 8px;
|
|
33
|
+
background: linear-gradient(135deg, #7c3aed, #2563eb);
|
|
34
|
+
display: flex; align-items: center; justify-content: center;
|
|
35
|
+
font-size: 16px; flex-shrink: 0;
|
|
36
|
+
}
|
|
37
|
+
.header-title { font-size: 15px; font-weight: 600; color: #f0f6fc; }
|
|
38
|
+
.header-sub { font-size: 11px; color: #8b949e; }
|
|
39
|
+
|
|
40
|
+
/* Status bar */
|
|
41
|
+
.status-bar {
|
|
42
|
+
display: flex; align-items: center; gap: 8px;
|
|
43
|
+
padding: 10px 16px;
|
|
44
|
+
background: #161b22;
|
|
45
|
+
border-bottom: 1px solid #21262d;
|
|
46
|
+
}
|
|
47
|
+
.status-dot {
|
|
48
|
+
width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
|
|
49
|
+
}
|
|
50
|
+
.status-dot.connected { background: #3fb950; box-shadow: 0 0 6px #3fb95066; }
|
|
51
|
+
.status-dot.connecting { background: #d29922; animation: pulse 1s infinite; }
|
|
52
|
+
.status-dot.disconnected { background: #f85149; }
|
|
53
|
+
@keyframes pulse { 0%,100% { opacity:1 } 50% { opacity:0.3 } }
|
|
54
|
+
.status-text { flex: 1; font-weight: 500; }
|
|
55
|
+
.status-detail { font-size: 11px; color: #8b949e; font-family: monospace; }
|
|
56
|
+
|
|
57
|
+
/* Tabs — scrollable for 7 tabs */
|
|
58
|
+
.tab-bar {
|
|
59
|
+
display: flex;
|
|
60
|
+
background: #161b22;
|
|
61
|
+
border-bottom: 1px solid #21262d;
|
|
62
|
+
overflow-x: auto;
|
|
63
|
+
scrollbar-width: none;
|
|
64
|
+
}
|
|
65
|
+
.tab-bar::-webkit-scrollbar { display: none; }
|
|
66
|
+
.tab-btn {
|
|
67
|
+
flex: 0 0 auto;
|
|
68
|
+
padding: 8px 10px;
|
|
69
|
+
background: none;
|
|
70
|
+
border: none;
|
|
71
|
+
border-bottom: 2px solid transparent;
|
|
72
|
+
color: #8b949e;
|
|
73
|
+
font-size: 11px;
|
|
74
|
+
font-weight: 500;
|
|
75
|
+
cursor: pointer;
|
|
76
|
+
text-align: center;
|
|
77
|
+
white-space: nowrap;
|
|
78
|
+
}
|
|
79
|
+
.tab-btn:hover { color: #c9d1d9; }
|
|
80
|
+
.tab-btn.active {
|
|
81
|
+
color: #58a6ff;
|
|
82
|
+
border-bottom-color: #58a6ff;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* Panels */
|
|
86
|
+
.panel { display: none; padding: 12px 16px; }
|
|
87
|
+
.panel.active { display: block; }
|
|
88
|
+
|
|
89
|
+
/* Stats grid */
|
|
90
|
+
.stats-grid {
|
|
91
|
+
display: grid;
|
|
92
|
+
grid-template-columns: 1fr 1fr;
|
|
93
|
+
gap: 8px;
|
|
94
|
+
margin-bottom: 12px;
|
|
95
|
+
}
|
|
96
|
+
.stat-card {
|
|
97
|
+
padding: 10px;
|
|
98
|
+
background: #161b22;
|
|
99
|
+
border: 1px solid #21262d;
|
|
100
|
+
border-radius: 8px;
|
|
101
|
+
}
|
|
102
|
+
.stat-val {
|
|
103
|
+
font-size: 20px;
|
|
104
|
+
font-weight: 700;
|
|
105
|
+
color: #f0f6fc;
|
|
106
|
+
font-family: monospace;
|
|
107
|
+
}
|
|
108
|
+
.stat-label {
|
|
109
|
+
font-size: 10px;
|
|
110
|
+
color: #8b949e;
|
|
111
|
+
text-transform: uppercase;
|
|
112
|
+
letter-spacing: 0.5px;
|
|
113
|
+
margin-top: 2px;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/* Test suite */
|
|
117
|
+
.test-list { display: flex; flex-direction: column; gap: 6px; }
|
|
118
|
+
.test-item {
|
|
119
|
+
display: flex;
|
|
120
|
+
align-items: center;
|
|
121
|
+
gap: 8px;
|
|
122
|
+
padding: 8px 10px;
|
|
123
|
+
background: #161b22;
|
|
124
|
+
border: 1px solid #21262d;
|
|
125
|
+
border-radius: 6px;
|
|
126
|
+
cursor: pointer;
|
|
127
|
+
transition: border-color 0.15s;
|
|
128
|
+
}
|
|
129
|
+
.test-item:hover { border-color: #30363d; }
|
|
130
|
+
.test-item.running { border-color: #d29922; }
|
|
131
|
+
.test-item.pass { border-color: #3fb950; }
|
|
132
|
+
.test-item.fail { border-color: #f85149; }
|
|
133
|
+
.test-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
|
|
134
|
+
.test-name { flex: 1; font-weight: 500; font-size: 12px; }
|
|
135
|
+
.test-detail { font-size: 10px; color: #8b949e; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
136
|
+
.test-ms { font-size: 10px; color: #8b949e; font-family: monospace; min-width: 40px; text-align: right; }
|
|
137
|
+
|
|
138
|
+
/* Log viewer */
|
|
139
|
+
.log-container {
|
|
140
|
+
background: #010409;
|
|
141
|
+
border: 1px solid #21262d;
|
|
142
|
+
border-radius: 6px;
|
|
143
|
+
max-height: 280px;
|
|
144
|
+
overflow-y: auto;
|
|
145
|
+
font-family: "SF Mono", "Fira Code", monospace;
|
|
146
|
+
font-size: 10px;
|
|
147
|
+
line-height: 1.6;
|
|
148
|
+
}
|
|
149
|
+
.log-entry {
|
|
150
|
+
padding: 2px 8px;
|
|
151
|
+
border-bottom: 1px solid #21262d0a;
|
|
152
|
+
display: flex;
|
|
153
|
+
gap: 6px;
|
|
154
|
+
}
|
|
155
|
+
.log-entry:hover { background: #161b2240; }
|
|
156
|
+
.log-ts { color: #484f58; min-width: 65px; flex-shrink: 0; }
|
|
157
|
+
.log-lvl { min-width: 36px; flex-shrink: 0; font-weight: 600; }
|
|
158
|
+
.log-lvl.info { color: #58a6ff; }
|
|
159
|
+
.log-lvl.warn { color: #d29922; }
|
|
160
|
+
.log-lvl.error { color: #f85149; }
|
|
161
|
+
.log-lvl.tool { color: #a5d6ff; }
|
|
162
|
+
.log-lvl.ws { color: #7ee787; }
|
|
163
|
+
.log-msg { color: #c9d1d9; word-break: break-all; }
|
|
164
|
+
.log-data { color: #484f58; word-break: break-all; }
|
|
165
|
+
|
|
166
|
+
/* Buttons */
|
|
167
|
+
.btn {
|
|
168
|
+
padding: 8px 14px;
|
|
169
|
+
border-radius: 6px;
|
|
170
|
+
border: 1px solid #30363d;
|
|
171
|
+
background: #21262d;
|
|
172
|
+
color: #c9d1d9;
|
|
173
|
+
font-size: 12px;
|
|
174
|
+
font-weight: 500;
|
|
175
|
+
cursor: pointer;
|
|
176
|
+
transition: background 0.15s;
|
|
177
|
+
}
|
|
178
|
+
.btn:hover { background: #30363d; }
|
|
179
|
+
.btn:active { background: #3a424d; }
|
|
180
|
+
.btn-primary { background: #238636; border-color: #2ea043; color: #fff; }
|
|
181
|
+
.btn-primary:hover { background: #2ea043; }
|
|
182
|
+
.btn-danger { background: #da3633; border-color: #f85149; color: #fff; }
|
|
183
|
+
.btn-danger:hover { background: #f85149; }
|
|
184
|
+
.btn-row { display: flex; gap: 8px; margin-top: 12px; }
|
|
185
|
+
.btn-row .btn { flex: 1; text-align: center; }
|
|
186
|
+
|
|
187
|
+
/* Tab info */
|
|
188
|
+
.tab-info-list { display: flex; flex-direction: column; gap: 4px; }
|
|
189
|
+
.tab-info-item {
|
|
190
|
+
padding: 6px 8px;
|
|
191
|
+
background: #161b22;
|
|
192
|
+
border: 1px solid #21262d;
|
|
193
|
+
border-radius: 4px;
|
|
194
|
+
font-size: 11px;
|
|
195
|
+
}
|
|
196
|
+
.tab-info-item .tab-url {
|
|
197
|
+
color: #58a6ff;
|
|
198
|
+
font-family: monospace;
|
|
199
|
+
font-size: 10px;
|
|
200
|
+
word-break: break-all;
|
|
201
|
+
}
|
|
202
|
+
.tab-info-item .tab-title { font-weight: 500; }
|
|
203
|
+
.tab-active-badge {
|
|
204
|
+
display: inline-block;
|
|
205
|
+
padding: 1px 5px;
|
|
206
|
+
border-radius: 3px;
|
|
207
|
+
background: #238636;
|
|
208
|
+
color: #fff;
|
|
209
|
+
font-size: 9px;
|
|
210
|
+
font-weight: 600;
|
|
211
|
+
margin-left: 4px;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/* Summary bar */
|
|
215
|
+
.test-summary {
|
|
216
|
+
display: flex; gap: 12px; margin-bottom: 10px;
|
|
217
|
+
padding: 8px 10px;
|
|
218
|
+
background: #161b22;
|
|
219
|
+
border-radius: 6px;
|
|
220
|
+
border: 1px solid #21262d;
|
|
221
|
+
font-size: 12px;
|
|
222
|
+
align-items: center;
|
|
223
|
+
}
|
|
224
|
+
.test-summary .pass-count { color: #3fb950; font-weight: 600; }
|
|
225
|
+
.test-summary .fail-count { color: #f85149; font-weight: 600; }
|
|
226
|
+
.section-title {
|
|
227
|
+
font-size: 11px; font-weight: 600; color: #8b949e;
|
|
228
|
+
text-transform: uppercase; letter-spacing: 0.5px;
|
|
229
|
+
margin: 12px 0 8px;
|
|
230
|
+
}
|
|
231
|
+
.section-title:first-child { margin-top: 0; }
|
|
232
|
+
|
|
233
|
+
/* Network entries */
|
|
234
|
+
.net-entry {
|
|
235
|
+
display: flex; align-items: center; gap: 6px;
|
|
236
|
+
padding: 3px 8px;
|
|
237
|
+
border-bottom: 1px solid #21262d0a;
|
|
238
|
+
font-family: "SF Mono", "Fira Code", monospace;
|
|
239
|
+
font-size: 10px; line-height: 1.5;
|
|
240
|
+
}
|
|
241
|
+
.net-entry:hover { background: #161b2240; }
|
|
242
|
+
.net-status {
|
|
243
|
+
min-width: 28px; text-align: center; font-weight: 700;
|
|
244
|
+
border-radius: 3px; padding: 1px 4px;
|
|
245
|
+
}
|
|
246
|
+
.net-status.s2xx { color: #3fb950; }
|
|
247
|
+
.net-status.s3xx { color: #d29922; }
|
|
248
|
+
.net-status.s4xx, .net-status.s5xx { color: #f85149; }
|
|
249
|
+
.net-method {
|
|
250
|
+
min-width: 32px; font-weight: 600; color: #58a6ff;
|
|
251
|
+
font-size: 9px; text-transform: uppercase;
|
|
252
|
+
}
|
|
253
|
+
.net-type { min-width: 40px; color: #8b949e; font-size: 9px; }
|
|
254
|
+
.net-url { flex: 1; color: #c9d1d9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
255
|
+
.net-ts { color: #484f58; min-width: 55px; text-align: right; flex-shrink: 0; }
|
|
256
|
+
|
|
257
|
+
/* Console entries */
|
|
258
|
+
.con-entry {
|
|
259
|
+
display: flex; gap: 6px;
|
|
260
|
+
padding: 2px 8px;
|
|
261
|
+
border-bottom: 1px solid #21262d0a;
|
|
262
|
+
font-family: "SF Mono", "Fira Code", monospace;
|
|
263
|
+
font-size: 10px; line-height: 1.6;
|
|
264
|
+
}
|
|
265
|
+
.con-entry:hover { background: #161b2240; }
|
|
266
|
+
.con-lvl { min-width: 36px; font-weight: 600; flex-shrink: 0; }
|
|
267
|
+
.con-lvl.log, .con-lvl.info { color: #58a6ff; }
|
|
268
|
+
.con-lvl.warn { color: #d29922; }
|
|
269
|
+
.con-lvl.error { color: #f85149; }
|
|
270
|
+
.con-lvl.debug { color: #8b949e; }
|
|
271
|
+
.con-msg { color: #c9d1d9; word-break: break-all; }
|
|
272
|
+
|
|
273
|
+
/* Storage sections */
|
|
274
|
+
.storage-section {
|
|
275
|
+
background: #161b22; border: 1px solid #21262d;
|
|
276
|
+
border-radius: 6px; margin-bottom: 8px; overflow: hidden;
|
|
277
|
+
}
|
|
278
|
+
.storage-header {
|
|
279
|
+
display: flex; align-items: center; gap: 6px;
|
|
280
|
+
padding: 8px 10px; cursor: pointer;
|
|
281
|
+
font-size: 11px; font-weight: 600; color: #c9d1d9;
|
|
282
|
+
}
|
|
283
|
+
.storage-header:hover { background: #1c2333; }
|
|
284
|
+
.storage-chevron { transition: transform 0.15s; font-size: 10px; color: #8b949e; }
|
|
285
|
+
.storage-chevron.open { transform: rotate(90deg); }
|
|
286
|
+
.storage-count {
|
|
287
|
+
font-size: 9px; color: #8b949e; font-weight: 400;
|
|
288
|
+
background: #21262d; border-radius: 10px; padding: 1px 6px;
|
|
289
|
+
}
|
|
290
|
+
.storage-body { display: none; }
|
|
291
|
+
.storage-body.open { display: block; }
|
|
292
|
+
.storage-row {
|
|
293
|
+
display: flex; align-items: center; gap: 6px;
|
|
294
|
+
padding: 4px 10px;
|
|
295
|
+
border-top: 1px solid #21262d;
|
|
296
|
+
font-size: 10px; font-family: monospace;
|
|
297
|
+
}
|
|
298
|
+
.storage-row:hover { background: #1c233340; }
|
|
299
|
+
.storage-key { color: #58a6ff; min-width: 80px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
300
|
+
.storage-val { flex: 1; color: #c9d1d9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
301
|
+
.storage-del {
|
|
302
|
+
background: none; border: none; color: #f85149; cursor: pointer;
|
|
303
|
+
font-size: 12px; padding: 0 4px; flex-shrink: 0; opacity: 0.6;
|
|
304
|
+
}
|
|
305
|
+
.storage-del:hover { opacity: 1; }
|
|
306
|
+
.storage-empty { padding: 8px 10px; color: #484f58; font-size: 10px; border-top: 1px solid #21262d; }
|
|
307
|
+
|
|
308
|
+
/* Filter row for panels */
|
|
309
|
+
.panel-toolbar {
|
|
310
|
+
display: flex; gap: 8px; margin-bottom: 8px; align-items: center;
|
|
311
|
+
}
|
|
312
|
+
.panel-filter {
|
|
313
|
+
flex: 1; padding: 5px 8px; border-radius: 4px;
|
|
314
|
+
border: 1px solid #30363d; background: #0d1117;
|
|
315
|
+
color: #c9d1d9; font-size: 11px; font-family: monospace;
|
|
316
|
+
}
|
|
317
|
+
.panel-filter::placeholder { color: #484f58; }
|
|
318
|
+
</style>
|
|
319
|
+
</head>
|
|
320
|
+
<body>
|
|
321
|
+
<!-- Header -->
|
|
322
|
+
<div class="header">
|
|
323
|
+
<div class="header-icon">⚡</div>
|
|
324
|
+
<div>
|
|
325
|
+
<div class="header-title">CFC Bridge</div>
|
|
326
|
+
<div class="header-sub">Claude in Chrome — Edge Android</div>
|
|
327
|
+
<div class="header-sub" id="versionInfo" style="color:#58a6ff;font-family:monospace"></div>
|
|
328
|
+
</div>
|
|
329
|
+
</div>
|
|
330
|
+
|
|
331
|
+
<!-- Status bar -->
|
|
332
|
+
<div class="status-bar">
|
|
333
|
+
<div class="status-dot" id="statusDot"></div>
|
|
334
|
+
<span class="status-text" id="statusText">Loading...</span>
|
|
335
|
+
<span class="status-detail" id="statusDetail"></span>
|
|
336
|
+
</div>
|
|
337
|
+
|
|
338
|
+
<!-- Tab navigation -->
|
|
339
|
+
<div class="tab-bar">
|
|
340
|
+
<button class="tab-btn active" data-panel="dashboard">Dashboard</button>
|
|
341
|
+
<button class="tab-btn" data-panel="tests">Tests</button>
|
|
342
|
+
<button class="tab-btn" data-panel="logs">Logs</button>
|
|
343
|
+
<button class="tab-btn" data-panel="tabs">Tabs</button>
|
|
344
|
+
<button class="tab-btn" data-panel="network">Network</button>
|
|
345
|
+
<button class="tab-btn" data-panel="console">Console</button>
|
|
346
|
+
<button class="tab-btn" data-panel="storage">Storage</button>
|
|
347
|
+
</div>
|
|
348
|
+
|
|
349
|
+
<!-- Dashboard panel -->
|
|
350
|
+
<div class="panel active" id="panel-dashboard">
|
|
351
|
+
<div class="stats-grid">
|
|
352
|
+
<div class="stat-card">
|
|
353
|
+
<div class="stat-val" id="stat-requests">0</div>
|
|
354
|
+
<div class="stat-label">Tool Requests</div>
|
|
355
|
+
</div>
|
|
356
|
+
<div class="stat-card">
|
|
357
|
+
<div class="stat-val" id="stat-errors">0</div>
|
|
358
|
+
<div class="stat-label">Errors</div>
|
|
359
|
+
</div>
|
|
360
|
+
<div class="stat-card">
|
|
361
|
+
<div class="stat-val" id="stat-uptime">--</div>
|
|
362
|
+
<div class="stat-label">Connected</div>
|
|
363
|
+
</div>
|
|
364
|
+
<div class="stat-card">
|
|
365
|
+
<div class="stat-val" id="stat-tabs">0</div>
|
|
366
|
+
<div class="stat-label">Tabs</div>
|
|
367
|
+
</div>
|
|
368
|
+
</div>
|
|
369
|
+
<div class="section-title">Last Tool</div>
|
|
370
|
+
<div class="stat-card" style="margin-bottom:8px">
|
|
371
|
+
<div style="font-size:12px;color:#f0f6fc;font-weight:500" id="stat-lasttool">None</div>
|
|
372
|
+
</div>
|
|
373
|
+
<div class="btn-row">
|
|
374
|
+
<button class="btn btn-primary" id="btn-reconnect">Reconnect</button>
|
|
375
|
+
<button class="btn" id="btn-launch-bridge">Launch Bridge</button>
|
|
376
|
+
<button class="btn btn-danger" id="btn-stop-bridge" style="display:none">Stop</button>
|
|
377
|
+
</div>
|
|
378
|
+
<div class="btn-row" style="margin-top:6px">
|
|
379
|
+
<button class="btn" id="btn-update" style="flex:1">
|
|
380
|
+
<span id="btn-update-text">Check for Update</span>
|
|
381
|
+
</button>
|
|
382
|
+
</div>
|
|
383
|
+
<div class="section-title" style="margin-top:12px">Memory</div>
|
|
384
|
+
<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
|
+
<input type="checkbox" id="chk-inject-all" style="accent-color:#58a6ff">
|
|
386
|
+
<span>Inject into all pages</span>
|
|
387
|
+
<span style="flex:1"></span>
|
|
388
|
+
<span style="font-size:10px;color:#8b949e" id="inject-mode-label">on-demand</span>
|
|
389
|
+
</label>
|
|
390
|
+
</div>
|
|
391
|
+
|
|
392
|
+
<!-- Tests panel -->
|
|
393
|
+
<div class="panel" id="panel-tests">
|
|
394
|
+
<div class="test-summary">
|
|
395
|
+
<span>Results:</span>
|
|
396
|
+
<span class="pass-count" id="test-pass-count">0 passed</span>
|
|
397
|
+
<span class="fail-count" id="test-fail-count">0 failed</span>
|
|
398
|
+
<span style="flex:1"></span>
|
|
399
|
+
<button class="btn" id="btn-run-all" style="padding:4px 10px;font-size:11px">Run All</button>
|
|
400
|
+
</div>
|
|
401
|
+
<div class="test-list" id="test-list"></div>
|
|
402
|
+
</div>
|
|
403
|
+
|
|
404
|
+
<!-- Logs panel -->
|
|
405
|
+
<div class="panel" id="panel-logs">
|
|
406
|
+
<div style="display:flex;gap:8px;margin-bottom:8px;align-items:center">
|
|
407
|
+
<span class="section-title" style="margin:0;flex:1">Message Log</span>
|
|
408
|
+
<button class="btn" id="btn-refresh-logs" style="padding:4px 10px;font-size:11px">Refresh</button>
|
|
409
|
+
</div>
|
|
410
|
+
<div class="log-container" id="log-container"></div>
|
|
411
|
+
</div>
|
|
412
|
+
|
|
413
|
+
<!-- Tabs panel -->
|
|
414
|
+
<div class="panel" id="panel-tabs">
|
|
415
|
+
<div class="section-title">MCP Tab Group</div>
|
|
416
|
+
<div class="tab-info-list" id="tab-info-list"></div>
|
|
417
|
+
</div>
|
|
418
|
+
|
|
419
|
+
<!-- Network panel -->
|
|
420
|
+
<div class="panel" id="panel-network">
|
|
421
|
+
<div class="panel-toolbar">
|
|
422
|
+
<input class="panel-filter" id="network-filter" type="text" placeholder="Filter by URL or type...">
|
|
423
|
+
<button class="btn" id="btn-clear-network" style="padding:4px 10px;font-size:11px">Clear</button>
|
|
424
|
+
</div>
|
|
425
|
+
<div class="log-container" id="network-list" style="max-height:340px"></div>
|
|
426
|
+
</div>
|
|
427
|
+
|
|
428
|
+
<!-- Console panel -->
|
|
429
|
+
<div class="panel" id="panel-console">
|
|
430
|
+
<div class="panel-toolbar">
|
|
431
|
+
<input class="panel-filter" id="console-filter" type="text" placeholder="Filter messages...">
|
|
432
|
+
<button class="btn" id="btn-clear-console" style="padding:4px 10px;font-size:11px">Clear</button>
|
|
433
|
+
</div>
|
|
434
|
+
<div class="log-container" id="console-list" style="max-height:340px"></div>
|
|
435
|
+
</div>
|
|
436
|
+
|
|
437
|
+
<!-- Storage panel -->
|
|
438
|
+
<div class="panel" id="panel-storage">
|
|
439
|
+
<div id="storage-sections"></div>
|
|
440
|
+
</div>
|
|
441
|
+
|
|
442
|
+
<script src="popup.js"></script>
|
|
443
|
+
</body>
|
|
444
|
+
</html>
|