Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 51 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,56 @@
# Polyscope Chrome Extension

A companion browser extension for Polyscope.
A companion browser extension for [Polyscope](https://polyscope.dev) — connect your preview tabs to workspaces and use in-page tools like the element picker.

## Requirements

- [Node.js](https://nodejs.org) (v18 or later)
- npm

## Building from Source

**1. Clone the repository:**

```bash
git clone https://github.com/beyondcode/polyscope-chrome.git
cd polyscope-chrome
```

**2. Install root dependencies:**

```bash
npm install
```

**3. Install extension dependencies and build:**

```bash
cd packages/chrome-extension
npm install
npm run build
Comment on lines +27 to +30

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Build the extension against the checked-out SDK sources

These commands install @polyscope/sdk from npm, not from this checkout: packages/chrome-extension/package-lock.json:800-802 pins the dependency to the published sdk-0.1.0.tgz, and packages/chrome-extension/src/background/index.ts:8 imports that package directly. In practice, someone following this new “Building from Source” section will get a bundle that ignores any local edits under src/sdk/, so it is easy to validate the wrong code after making source changes in this repo.

Useful? React with 👍 / 👎.

```

The compiled extension will be output to `packages/chrome-extension/dist/`.

### Available Scripts

From the `packages/chrome-extension` directory:

| Command | Description |
|---|---|
| `npm run build` | Production build |
| `npm run dev` | Build in watch mode (rebuilds on file changes) |
| `npm run typecheck` | Run TypeScript type checking without emitting files |
| `npm run package` | Build and create a `.zip` ready for the Chrome Web Store |

## Installing in Chrome

1. Open Chrome and navigate to `chrome://extensions`
2. Enable **Developer mode** using the toggle in the top-right corner
3. Click **Load unpacked**
4. Select the `packages/chrome-extension/dist/` folder

The extension icon will appear in your Chrome toolbar. Click it to toggle in-page tools on or off. You can also activate the element picker with the keyboard shortcut `Alt+Shift+P`.
Comment on lines +50 to +53

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Document how users actually open the Polyscope panel

The install section currently stops at loading the unpacked extension and then says to click the toolbar icon, but the code does not expose the panel that way: packages/chrome-extension/public/manifest.json:13-21 has no default_popup, and packages/chrome-extension/src/background/index.ts:851-865 uses left-click to toggle in-page tools while the actual panel is only available from the action context menu. For a first-time user, following these steps leaves no documented path to sign in or choose a workspace, so the extension appears unusable after installation.

Useful? React with 👍 / 👎.


## License

Expand Down