{"id":41190201,"url":"https://github.com/zk1tty/rebrowse-ext","last_synced_at":"2026-01-22T20:22:33.723Z","repository":{"id":296893862,"uuid":"994883662","full_name":"zk1tty/rebrowse-ext","owner":"zk1tty","description":"Chrome extention app of Rebrowse","archived":false,"fork":false,"pushed_at":"2025-06-02T16:30:46.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-03T06:23:12.018Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zk1tty.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-02T16:19:34.000Z","updated_at":"2025-06-02T16:30:50.000Z","dependencies_parsed_at":"2025-06-03T06:44:43.198Z","dependency_job_id":null,"html_url":"https://github.com/zk1tty/rebrowse-ext","commit_stats":null,"previous_names":["zk1tty/rebrowse-ext"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zk1tty/rebrowse-ext","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zk1tty%2Frebrowse-ext","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zk1tty%2Frebrowse-ext/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zk1tty%2Frebrowse-ext/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zk1tty%2Frebrowse-ext/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zk1tty","download_url":"https://codeload.github.com/zk1tty/rebrowse-ext/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zk1tty%2Frebrowse-ext/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28670371,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T19:36:09.361Z","status":"ssl_error","status_checked_at":"2026-01-22T19:36:05.567Z","response_time":144,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-22T20:22:33.604Z","updated_at":"2026-01-22T20:22:33.692Z","avatar_url":"https://github.com/zk1tty.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chrome extension -- Rebrowse\n\n## Tech architecture\n- overall\n![Screenshot 2025-06-02 at 11 30 39 PM](https://github.com/user-attachments/assets/0480f653-7c48-4069-9c18-88a5c59cc984)\n\n### UI arc\n\n1. Chrome Extension UI (e.g., popup.html):\n  - Primary Role: Quick, in-context actions related to the active browser tab.\n  - Functionality:\n    - \"Start Recording\" button: Sends a message to background.js, which in turn will send a native message to host.py to initiate recording for the active tab.\n    - \"Stop Recording\" button: Similarly, tells host.py via background.js to stop recording and save the trace.\n  - Status: Could show very basic status like \"Recording\" / \"Idle\" / \"Error\". This status would likely be pushed from host.py back to background.js and then to the popup.\n\n2. Gradio UI (webui.py):\n  - Primary Role: More comprehensive trace management, replay functionality, detailed status display, and configuration.\n  - Functionality:\n    - Trace Management: Listing, selecting trace files (as you currently have).\n    - Replay: Initiating and controlling the replay of selected traces (as you currently have).\n    - Detailed Status/Logs: Displaying logs and status updates originating from host.py (e.g., \"Connected to browser,\" \"CDP event received,\" \"Recording started/stopped,\" errors from the native host). This is a key part of our minimal release.\n    - Configuration: (Future) Settings related to recording, replay, etc.\n\n### Process Sequence  \n\n1. Triggering a trace from Gradio and replaying\n  - NamePipe: a Streaming method of inter-process communication (IPC) that allows processes to communicate through a shared memory buffer.\n    `host.py`(one-writer) adn `webui.py`(one-reader) is connected with namepipe.\n  - multi-thread: we’ll graduate to Unix-domain sockets or a message broker for multi-reader or cross-machine delivery.\n  - Note: The chosen path /tmp/rebrowse_host_status.pipe is common for temporary pipes on Unix-like systems (Linux, macOS). on Windows, pywin32 library or a different IPC mechanism like sockets. \n![Screenshot 2025-06-03 at 6 54 50 PM](https://github.com/user-attachments/assets/39c0f0a3-1680-4c69-a827-531b32384da6)\n\n  | Step                     | Detail        |                                                                                                                                                                                                    \n  | ------------------------ | ------------------------ |\n  | 1. Gradio action         | The “Replay” button in `webui.py` calls an async function that writes a JSON command to the **FIFO** or hits a tiny HTTP endpoint exposed by `host.py`.                                                                                                                                                                                                          |\n  | 2. Native host picks tab | Because the extension already sent the active `tabId` when it started recording, `host.py` can resolve “same tab” by that ID or ask `background.js` for the current active tab if none recorded.                                                                                                                                                                 |\n  | 3. Native-message bridge | `host.py` sends `{cmd:\"replay\", trace:\u003carray_of_steps\u003e, tabId}` via `stdout`.  `background.js` receives it in `chrome.runtime.onMessageExternal`.                                                                                                                                                                                                                |\n  | 4. Replay driver         | The **simplest path** is for `background.js` to loop over the JSONL entries and translate each into a CDP call with `chrome.debugger.sendCommand`— ⚠️no Playwright needed for replay.  If you already have a Playwright “replayer” written, run it inside `host.py` *connected to the same Chrome instance* (`chromium.connect_over_cdp(\"http://localhost:9222\")`). |\n  | 5. Status back-flow      | After each step, `background.js` posts `{\"phase\":\"replay\",\"step\":n}` back to `host.py`, which writes “Replay 35 %” into the FIFO, so Gradio’s textbox autoscrolls.        |                                                                                                                  \n## Shipping layout\n| Artifact                      | File(s)                                                    | How user gets it                                                                                                                                                                                                                                                                                                |\n| ----------------------------- | ---------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **1. Chrome Extension**       | `rebrowse_ext.zip` → Web Store                             | • Contains `manifest.json`, `background.js`, `content.js`, icons, popup.\u003cbr\u003e• Lists permission `\"nativeMessaging\"` and host name `\"com.rebrowse.host\"`.                                                                                                                                                         |\n| **2. Native Host bundle**     | **macOS `.pkg` installer** \u003cbr\u003e*(or `.dmg` drag-and-drop)* | • Installs `rebrowse_native` self-contained binary (PyInstaller/Nuitka) to `/usr/local/bin/`.\u003cbr\u003e• Drops `com.rebrowse.host.json` into the NativeMessagingHosts folder, pointing at that binary.\u003cbr\u003e• Optionally adds a LaunchAgent so the binary runs head-less at login (hosting Gradio on `localhost:7860`). |\n| *(optional)* Thin menubar app | `RebrowseTray.app`                                         | Bundled inside the same `.pkg`; just UI glue that talks to `localhost:7860`.                                                                                                                                                                                                                                    |\n## Functionalities must-stay at local\n- Yes—cloud can own storage, scheduling, analytics, auth.\n- No—real-time browser control still needs a local process (or all-JS code in the extension) because of Chrome security boundaries.\n- Path forward: shrink host.py to a minimal relay, migrate everything else to your cloud dashboard, and revisit an all-extension architecture once your replay/record logic is fully ported to TypeScript.\n\n| Need                                                     | Why cloud can’t replace it                                                                                                              |\n| -------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| **CDP commands** (`Input.dispatchKeyEvent`, `DOM.click`) | Chrome blocks remote WebSockets from the public Internet; only a process on `127.0.0.1` that owns the debugging port can drive the tab. |\n| **Native file dialogs / clipboard**                      | Clipboard / file-picker APIs are exposed only to extensions or native apps, not to remote origins.                                      |\n| **Low-latency event feedback**                           | 20-50 ms round-trip over localhost vs. 200 + ms to the nearest PoP; user-perceived lag matters for live overlays, type-ahead, etc.      |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzk1tty%2Frebrowse-ext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzk1tty%2Frebrowse-ext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzk1tty%2Frebrowse-ext/lists"}