Files
oh-my-pi/packages/browser-relay/extension/options.js
T
can1357 92c79d80c7 feat: introduced OMP Browser Relay extension with CDP RPC execution
- Implement the OMP Browser Relay extension with WebSocket communication and CDP RPC execution.
- Add browser relay server, daemon management, and bridge multiplexing in the coding agent.
- Introduce CLI commands and settings schema options for configuring and installing the relay.
- Add utility functions and test suites supporting environment parsing and relay lifecycle handling.
2026-08-02 05:33:07 +02:00

24 lines
810 B
JavaScript

// Options page for the OMP Browser Relay extension (plain JS: shipped as-is).
const DEFAULT_PORT = 9224;
const portInput = document.getElementById("port");
const tokenInput = document.getElementById("token");
const status = document.getElementById("status");
chrome.storage.local.get({ port: DEFAULT_PORT, token: "" }).then(stored => {
portInput.value = String(stored.port);
tokenInput.value = String(stored.token);
});
document.getElementById("save").addEventListener("click", async () => {
const port = Number(portInput.value);
if (!Number.isInteger(port) || port <= 0 || port > 65535) {
status.textContent = "invalid port";
return;
}
await chrome.storage.local.set({ port, token: tokenInput.value });
status.textContent = "saved";
setTimeout(() => {
status.textContent = "";
}, 1500);
});