|
3 | 3 | This is a browser extension to add a custom Bookmarks view to the collection of GitHub built-in |
4 | 4 | views at: `github.com/issues` |
5 | 5 |
|
| 6 | +The GitHub repo is: richardkmichael/github-bookmarked-issues |
| 7 | + |
6 | 8 | # Implementation |
7 | 9 |
|
8 | 10 | The github.com/issues page has GitHub built-in views as a React app: |
@@ -341,3 +343,71 @@ template.innerHTML = '<svg aria-hidden="true" viewBox="0 0 16 16"><path d="M3 2. |
341 | 343 | 3. **textContent auto-escapes**: No need for `escapeHtml()` helpers |
342 | 344 | 4. **Zero warnings**: This approach eliminates all web-ext linter warnings |
343 | 345 | 5. **Readable code**: Templates keep HTML structure visible and maintainable |
| 346 | + |
| 347 | +# Researching Primer CSS |
| 348 | + |
| 349 | +## Caching Primer Source |
| 350 | + |
| 351 | +To avoid repeatedly downloading Primer CSS when searching for class names or patterns: |
| 352 | + |
| 353 | +1. Check if already cached: `ls tmp/primer-css/` |
| 354 | +2. If not cached, download once: |
| 355 | + ```bash |
| 356 | + mkdir -p tmp && cd tmp |
| 357 | + npm pack @primer/css && tar -xzf primer-css-*.tgz && mv package primer-css |
| 358 | + ``` |
| 359 | +3. Search the cached source: `grep -r "pattern" tmp/primer-css/` |
| 360 | + |
| 361 | +## Primer View Components |
| 362 | + |
| 363 | +Between Primer v21 and v22, components were extracted from main Primer to separate packages like |
| 364 | +`primer_view_components`. When implementing UI elements that match GitHub's style: |
| 365 | + |
| 366 | +1. First inspect the live GitHub page to see actual class names |
| 367 | +2. Search Primer CSS for the class patterns |
| 368 | +3. If not found, check `primer_view_components` or other Primer-related packages |
| 369 | +4. Example: Label classes were found by reviewing the label view component implementation |
| 370 | + |
| 371 | +# Development Commands |
| 372 | + |
| 373 | +## Reloading the Extension |
| 374 | + |
| 375 | +After code changes: |
| 376 | + |
| 377 | +Chrome: |
| 378 | +1. `npm run build:chrome` |
| 379 | +2. Go to `chrome://extensions` |
| 380 | +3. Click the refresh icon on the extension card |
| 381 | + |
| 382 | +Firefox: |
| 383 | +1. `npm run build:firefox` (or just reload if using symlink method) |
| 384 | +2. Go to `about:debugging#/runtime/this-firefox` |
| 385 | +3. Click "Reload" on the extension |
| 386 | + |
| 387 | +With watch mode (`npm run dev:watch`), step 1 is automatic - just reload in the browser. |
| 388 | + |
| 389 | +## Reading Extension Errors |
| 390 | + |
| 391 | +Chrome: |
| 392 | +- `chrome://extensions` → Click "Errors" on the extension card |
| 393 | +- Or: Click "Inspect views service worker" → Console tab |
| 394 | + |
| 395 | +Firefox: |
| 396 | +- `about:debugging#/runtime/this-firefox` → Click "Inspect" on the extension |
| 397 | +- Console tab shows errors from background script |
| 398 | + |
| 399 | +Content script errors appear in the page's DevTools console (F12 on github.com). |
| 400 | + |
| 401 | +# MCP Chrome DevTools |
| 402 | + |
| 403 | +The `chrome-devtools` MCP server connects to Chrome Canary for automated browser control. |
| 404 | + |
| 405 | +## Handle chrome-devtools MCP server error |
| 406 | + |
| 407 | +When any chrome-devtools tool returns this error: |
| 408 | + |
| 409 | +``` |
| 410 | +Error: Could not connect to Chrome. Check if Chrome is running and remote debugging is enabled by going to chrome://inspect/#remote-debugging. |
| 411 | +``` |
| 412 | + |
| 413 | +Start Chrome manually with: `./chrome-canary.sh --start` |
0 commit comments