this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fixes

alice 8a8c1508 96eedc06

+70 -20
+1
.windsurfrules
··· 1 + We are using bun for package management (not runtime).
+7 -5
bun.lock
··· 5 5 "name": "at-wormhole-chrome", 6 6 "devDependencies": { 7 7 "@crxjs/vite-plugin": "latest", 8 - "@eslint/js": "^9.27.0", 8 + "@eslint/js": "latest", 9 9 "@types/bun": "latest", 10 10 "@types/chrome": "latest", 11 11 "@types/node": "latest", 12 - "eslint": "^9.27.0", 13 - "globals": "^16.1.0", 12 + "eslint": "latest", 13 + "globals": "latest", 14 14 "prettier": "latest", 15 15 "typescript": "latest", 16 - "typescript-eslint": "^8.32.1", 16 + "typescript-eslint": "latest", 17 17 "vite": "latest", 18 18 }, 19 19 }, ··· 215 215 216 216 "@types/json-schema": ["@types/json-schema@7.0.15", "", {}, "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA=="], 217 217 218 - "@types/node": ["@types/node@22.15.18", "", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-v1DKRfUdyW+jJhZNEI1PYy29S2YRxMV5AOO/x/SjKmW0acCIOqmbj6Haf9eHAhsPmrhlHSxEhv/1WszcLWV4cg=="], 218 + "@types/node": ["@types/node@22.15.19", "", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-3vMNr4TzNQyjHcRZadojpRaD9Ofr6LsonZAoQ+HMUa/9ORTPoxVIw0e0mpqWpdjj8xybyCM+oKOUH2vwFu/oEw=="], 219 219 220 220 "@typescript-eslint/eslint-plugin": ["@typescript-eslint/eslint-plugin@8.32.1", "", { "dependencies": { "@eslint-community/regexpp": "^4.10.0", "@typescript-eslint/scope-manager": "8.32.1", "@typescript-eslint/type-utils": "8.32.1", "@typescript-eslint/utils": "8.32.1", "@typescript-eslint/visitor-keys": "8.32.1", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", "ts-api-utils": "^2.1.0" }, "peerDependencies": { "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <5.9.0" } }, "sha512-6u6Plg9nP/J1GRpe/vcjjabo6Uc5YQPAMxsgQyGC/I0RuukiG1wIe3+Vtg3IrSCVJDmqK3j8adrtzXSENRtFgg=="], 221 221 ··· 548 548 "@typescript-eslint/typescript-estree/semver": ["semver@7.7.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA=="], 549 549 550 550 "@vitejs/plugin-react/react-refresh": ["react-refresh@0.17.0", "", {}, "sha512-z6F7K9bV85EfseRCp2bzrpyQ0Gkw1uLoCel9XBVWPg/TjRj94SkJzUTGfOa4bs7iJvBWtQG0Wq7wnI0syw3EBQ=="], 551 + 552 + "bun-types/@types/node": ["@types/node@22.15.18", "", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-v1DKRfUdyW+jJhZNEI1PYy29S2YRxMV5AOO/x/SjKmW0acCIOqmbj6Haf9eHAhsPmrhlHSxEhv/1WszcLWV4cg=="], 551 553 552 554 "connect-injector/debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="], 553 555
+4 -1
cleanup-plan.md
··· 54 54 - Add `short_name`, `author`, `homepage_url`, `version_name`. 55 55 - Replace `"tabs"` permission with `"activeTab"` unless (see §popup) we truly require `tabs`. 56 56 - Consider `host_permissions` wildcard `https://*/*` vs enumerating – keep explicit list for privacy. 57 - - Add `optional_host_permissions` for rarely-used sites. 58 57 - Add `action.default_title`. 59 58 - Add `browser_specific_settings` block for Firefox with `gecko.id`. 59 + - ~~Add `optional_host_permissions` for rarely-used sites.~~ **(Skipped: declaring all hosts upfront in `host_permissions` for simplicity)** 60 + - Add a Firefox MV2 fallback manifest (`manifest.firefox.json`) with `background.scripts` registering our service worker loader. (Firefox currently disables `service_worker` in MV3.) 61 + - ⚠️ Chrome MV3 rejects `background.scripts`; will need a Chrome-only build to remove it for final release. 62 + - ~~Implement separate Chrome/Firefox builds (output to `dist/chrome` and `dist/firefox` via `build:chrome`/`build:firefox` scripts).~~ **(Done)** 60 63 61 64 ## 5 · Source-Code Clean-up 62 65
+4 -4
package.json
··· 11 11 }, 12 12 "devDependencies": { 13 13 "@crxjs/vite-plugin": "latest", 14 - "@eslint/js": "^9.27.0", 14 + "@eslint/js": "latest", 15 15 "@types/bun": "latest", 16 16 "@types/chrome": "latest", 17 17 "@types/node": "latest", 18 - "eslint": "^9.27.0", 19 - "globals": "^16.1.0", 18 + "eslint": "latest", 19 + "globals": "latest", 20 20 "prettier": "latest", 21 21 "typescript": "latest", 22 - "typescript-eslint": "^8.32.1", 22 + "typescript-eslint": "latest", 23 23 "vite": "latest" 24 24 } 25 25 }
+13 -4
public/manifest.json
··· 1 1 { 2 2 "manifest_version": 3, 3 3 "default_locale": "en", 4 - 5 4 "name": "__MSG_extension_name__", 5 + "short_name": "Wormhole", 6 + "version": "1.0.0", 7 + "author": "aliceisjustplaying", 8 + "homepage_url": "https://github.com/aliceisjustplaying/at-wormhole-webextension", 6 9 "description": "__MSG_extension_description__", 7 - "version": "1.0", 8 10 9 11 "icons": { 10 12 "48": "images/icon_48.png", ··· 14 16 "512": "images/icon_512.png" 15 17 }, 16 18 17 - "permissions": ["activeTab", "contextMenus", "tabs", "storage"], 19 + "permissions": ["activeTab", "contextMenus", "storage"], 18 20 "host_permissions": [ 19 21 "https://public.api.bsky.app/*", 20 22 "https://plc.directory/*", ··· 31 33 ], 32 34 33 35 "background": { 34 - "service_worker": "src/background/service-worker.ts" 36 + "service_worker": "src/background/service-worker.ts", 37 + "scripts": ["src/background/service-worker.ts"] 35 38 }, 36 39 37 40 "action": { 41 + "default_title": "Wormhole", 38 42 "default_popup": "src/popup/popup.html", 39 43 "default_icon": { 40 44 "16": "images/icon_16.png", 41 45 "19": "images/icon_19.png", 42 46 "48": "images/icon_48.png", 43 47 "96": "images/icon_96.png" 48 + } 49 + }, 50 + "browser_specific_settings": { 51 + "gecko": { 52 + "id": "at-wormhole-chrome@mozilla.org" 44 53 } 45 54 } 46 55 }
+11
src/popup/popup.ts
··· 9 9 const list = document.getElementById('dest'); 10 10 const emptyBtn = document.getElementById('emptyCacheBtn'); 11 11 12 + // Close popup when a destination link is clicked (Firefox MV3 does not auto-close) 13 + list?.addEventListener('click', (e) => { 14 + const anchor = (e.target as HTMLElement).closest('a'); 15 + if (anchor && 'href' in anchor) { 16 + e.preventDefault(); 17 + e.stopPropagation(); 18 + chrome.tabs.create({ url: anchor.href }); 19 + window.close(); 20 + } 21 + }); 22 + 12 23 const showStatus = (msg) => (list.innerHTML = `<li>${msg}</li>`); 13 24 const createItem = ({ url, label }) => ` 14 25 <li>
+8
src/shared/constants.ts
··· 1 + /** 2 + * Shortcuts for NSIDs used in Bluesky/AT-Proto 3 + */ 4 + export const NSID_SHORTCUTS: Record<string, string> = { 5 + post: 'app.bsky.feed.post', 6 + feed: 'app.bsky.feed.generator', 7 + lists: 'app.bsky.graph.list', 8 + };
+1 -5
src/shared/transform.ts
··· 1 1 /** 2 2 * Shortcuts for NSIDs used in Bluesky/AT-Proto 3 3 */ 4 - export const NSID_SHORTCUTS: Record<string, string> = { 5 - post: 'app.bsky.feed.post', 6 - feed: 'app.bsky.feed.generator', 7 - lists: 'app.bsky.graph.list', 8 - }; 4 + import { NSID_SHORTCUTS } from './constants'; 9 5 10 6 /** 11 7 * Parses a raw input string (URL, DID, handle) and returns canonical info.
+21 -1
vite.config.ts
··· 1 1 import { defineConfig } from 'vite'; 2 2 import { crx } from '@crxjs/vite-plugin'; 3 3 import manifest from './public/manifest.json'; 4 + import fs from 'fs'; 5 + import path from 'path'; 4 6 5 7 export default defineConfig({ 6 - plugins: [crx({ manifest })], 8 + plugins: [ 9 + crx({ manifest }), 10 + { 11 + name: 'firefox-mv3-fix', 12 + writeBundle() { 13 + // Firefox MV3 requires a background.scripts entry 14 + // https://stackoverflow.com/a/78088358 15 + const mf = path.resolve(process.cwd(), 'dist/manifest.json'); 16 + if (fs.existsSync(mf)) { 17 + const m = JSON.parse(fs.readFileSync(mf, 'utf-8')); 18 + if (m.background && !m.background.scripts) { 19 + m.background.scripts = ['service-worker-loader.js']; 20 + fs.writeFileSync(mf, JSON.stringify(m, null, 2)); 21 + console.log('✔️ Injected background.scripts for Firefox MV3'); 22 + } 23 + } 24 + } 25 + } 26 + ] 7 27 });