diff --git a/README.md b/README.md index b9c39a1..4df4fff 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # TTS Study Assistant -A productivity tool for saving, organizing, and listening to notes from any website: a Chrome extension for quick capture and playback, a web dashboard, and a Go API. +A productivity tool for saving, organizing, and listening to notes from any website: a browser extension for Chrome and Firefox for quick capture and playback, a web dashboard, and a Go API. [![Chrome Web Store version](https://img.shields.io/chrome-web-store/v/lpnchhblldgnnjgmkbmanggilffhbnnp?label=Chrome%20Web%20Store)](https://chromewebstore.google.com/detail/tts-study-assistant/lpnchhblldgnnjgmkbmanggilffhbnnp) @@ -21,7 +21,7 @@ A productivity tool for saving, organizing, and listening to notes from any webs - `backend/` — Go/Fiber REST API: JWT auth, notes, AI summaries, user management - `frontend/` — React + Vite + shadcn/ui web dashboard -- `extension/` — Chrome extension for saving and listening to notes from any site +- `extension/` — browser extension (Chrome and Firefox) for saving and listening to notes from any site - `docs/screenshots/` — README and Chrome Web Store screenshots (1280×800) ## Quick start diff --git a/extension/README.md b/extension/README.md index db799d9..5fc7e2b 100644 --- a/extension/README.md +++ b/extension/README.md @@ -1,4 +1,4 @@ -# Chrome Extension — TTS Study Assistant +# Browser Extension — TTS Study Assistant Save text from any page as a note, listen to it, and get AI summaries. Plain Manifest V3 (vanilla JS modules, no build step), backed by the Go API in [`../backend`](../backend) and linking to the web dashboard in [`../frontend`](../frontend). diff --git a/extension/package.json b/extension/package.json index b9b08b5..442a175 100644 --- a/extension/package.json +++ b/extension/package.json @@ -1,7 +1,7 @@ { "name": "tts-study-assistant", "version": "0.3.4", - "description": "Instant text-to-speech Chrome extension with study features", + "description": "Instant text-to-speech browser extension for Chrome and Firefox, with study features", "scripts": { "test": "node --test tests/*.test.mjs" }, @@ -13,6 +13,8 @@ "tts", "text-to-speech", "chrome-extension", + "firefox", + "firefox-addon", "study", "learning" ], diff --git a/extension/tests/manifest.test.mjs b/extension/tests/manifest.test.mjs index e591501..e6ff1f9 100644 --- a/extension/tests/manifest.test.mjs +++ b/extension/tests/manifest.test.mjs @@ -116,6 +116,30 @@ test('command shortcuts avoid Alt+S and never clash', () => { } }); +test('the privacy policy words every declared data category and permission', () => { + // AMO reviewers compare the policy with the manifest. The frontend test + // checks the rendered page; this catches a manifest change the policy misses. + const policy = readFileSync(new URL('../frontend/src/pages/privacy-policy.tsx', root), 'utf8'); + const wording = { + websiteContent: 'text you select and save', + browsingActivity: 'address (URL) and title of the page', + authenticationInfo: 'Sessions: login tokens', + personallyIdentifyingInfo: 'your name, email address and password', + storage: 'storage', + tts: 'text-to-speech', + activeTab: 'active tab', + scripting: 'scripting', + contextMenus: 'context menus', + notifications: 'notifications', + }; + const declared = manifest.browser_specific_settings.gecko.data_collection_permissions.required; + for (const key of [...declared, ...manifest.permissions]) { + assert.ok(wording[key], `add policy wording for ${key} here and in frontend/src/pages/privacy-policy.tsx`); + assert.ok(policy.includes(wording[key]), `privacy policy doesn't mention ${key} ("${wording[key]}")`); + } + assert.ok(policy.includes('Chrome and Firefox'), 'the policy covers both browsers'); +}); + test('manifest and package.json versions match', () => { assert.equal(manifest.version, pkg.version); }); diff --git a/frontend/src/pages/privacy-policy.test.tsx b/frontend/src/pages/privacy-policy.test.tsx index a67ada1..27afa65 100644 --- a/frontend/src/pages/privacy-policy.test.tsx +++ b/frontend/src/pages/privacy-policy.test.tsx @@ -1,12 +1,55 @@ import { screen } from '@testing-library/react' import { renderApp } from '@/test/render-app' +// The data the extension declares in manifest.json (data_collection_permissions) +// and how the policy describes each. extension/tests/manifest.test.mjs checks +// the other direction: every declared category and permission is worded here. +const DESCRIBED: Record = { + websiteContent: /text you select and save/, + browsingActivity: /address \(URL\) and title of the page/, + authenticationInfo: /Sessions: login tokens/, + personallyIdentifyingInfo: /your name, email address and password/, +} + +async function renderPolicy() { + renderApp('/privacy-policy', { as: false }) + expect(await screen.findByRole('heading', { name: 'Privacy Policy' })).toBeInTheDocument() +} + describe('privacy policy page', () => { it('is public and describes server-side password hashing', async () => { - renderApp('/privacy-policy', { as: false }) - expect(await screen.findByRole('heading', { name: 'Privacy Policy' })).toBeInTheDocument() + await renderPolicy() expect(screen.getByText(/stored only as a salted hash/)).toBeInTheDocument() expect(screen.queryByText(/hashed on your device/)).not.toBeInTheDocument() - expect(screen.getByText(/prateeksharma\.2801@gmail\.com/)).toBeInTheDocument() + expect(screen.getAllByText(/prateeksharma\.2801@gmail\.com/).length).toBeGreaterThan(0) + }) + + it('covers the extension in both browsers, not only Chrome', async () => { + await renderPolicy() + expect(screen.getByText(/browser extension for Chrome and Firefox/)).toBeInTheDocument() + expect(screen.getByText(/The extension \(Chrome and Firefox\)/)).toBeInTheDocument() + expect(screen.queryByText(/The Chrome extension/)).not.toBeInTheDocument() + }) + + it('describes every data category the extension manifest declares', async () => { + await renderPolicy() + for (const [category, description] of Object.entries(DESCRIBED)) { + expect(screen.getByText(description), category).toBeInTheDocument() + } + }) + + it('says where data goes and how to delete it', async () => { + await renderPolicy() + expect(screen.getByText(/sent to our AI provider \(currently OpenAI\)/)).toBeInTheDocument() + expect(screen.getByText(/edit or delete any note at any time/)).toBeInTheDocument() + expect(screen.getByText(/To delete your account and all its notes, email us/)).toBeInTheDocument() + }) + + it('lists the extension permissions from the manifest', async () => { + await renderPolicy() + const text = screen.getByText(/asks only for what its features need/).textContent ?? '' + for (const wording of [/storage/, /text-to-speech/, /active tab/, /scripting/, /context menus/, /notifications/, /access to websites/]) { + expect(text).toMatch(wording) + } }) }) diff --git a/frontend/src/pages/privacy-policy.tsx b/frontend/src/pages/privacy-policy.tsx index b130a4f..a51aa08 100644 --- a/frontend/src/pages/privacy-policy.tsx +++ b/frontend/src/pages/privacy-policy.tsx @@ -1,29 +1,59 @@ import { Link } from 'react-router' import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' -const SECTIONS: { title: string; body: string }[] = [ - { title: 'Effective Date', body: '2024-06-01' }, +// Public at /privacy-policy: linked from the extension popup and from the +// Chrome Web Store and Firefox Add-ons listings. Keep "What We Collect" in step +// with data_collection_permissions in extension/manifest.json. + +type Section = { title: string; body: string; items?: string[] } + +export const EFFECTIVE_DATE = '2026-11-18' + +const SECTIONS: Section[] = [ + { title: 'Effective Date', body: EFFECTIVE_DATE }, + { + title: 'Who We Are', + body: 'TTS Study Assistant is a browser extension for Chrome and Firefox, together with this web dashboard and our backend server. This policy covers all three.', + }, { title: 'What We Collect', - body: 'We collect your email address and password for authentication. Your password is sent over an encrypted connection and stored only as a salted hash. When you save a note, the selected website content and its source URL are sent to our backend. No other personal, health, financial, or activity data is collected.', + body: 'Only what you give us when you use a feature:', + items: [ + 'Account: your name, email address and password. The password is sent over an encrypted connection and stored only as a salted hash.', + 'Notes: text you select and save, the address (URL) and title of the page it came from, that site’s domain, and any summary you ask for.', + 'Sessions: login tokens. They are kept in your browser; our server keeps refresh tokens only as a hash, with whether the session is from the extension or the dashboard.', + 'Server logs: your IP address and the time, path and result of each request to our server, used to run the service and limit abuse.', + ], + }, + { + title: 'What We Don’t Collect', + body: 'The extension sends nothing until you act: it does not record your browsing history, the pages you visit, or what you type. To show “Notes from this site”, the popup compares the current site with your saved notes on your device and only asks our server for notes from a site you have already saved from. Your speech settings (speed, on/off) stay in your browser’s extension storage, which your browser may sync between your devices. We use no analytics, advertising or tracking.', }, { title: 'How We Use Data', - body: 'Your data is used solely to provide the core features of the TTS Study Assistant: saving, organizing, and reading notes aloud. We do not sell or share your data with third parties.', + body: 'Your data is used solely to provide the TTS Study Assistant: saving, organizing, summarizing and reading notes aloud. Text is read aloud by your browser’s speech engine, not by our server; some voices offered by your browser or operating system are online services run by them. We do not sell your data or use it for advertising.', + }, + { + title: 'Who Else Receives It', + body: 'When you ask for a summary, the note’s text is sent to our AI provider (currently OpenAI) to generate it; nothing else about you is sent. Our servers and database are run by our hosting providers. We share data with no one else, except where the law requires it.', }, { title: 'Storage', - body: 'Notes and account data are stored securely on our servers. Authentication tokens are stored in your browser for session management.', + body: 'Notes and account data are stored on our servers and sent only over encrypted connections. Login tokens stay in your browser until you log out or they expire.', }, { - title: 'User Rights', - body: 'You may delete your notes or account at any time. Contact support for account deletion requests.', + title: 'Your Choices and Deleting Data', + body: 'You can edit or delete any note at any time from the dashboard, or delete it from the extension, and logging out removes your login tokens from that browser. To delete your account and all its notes, email us at the address below. Uninstalling the extension removes its settings and tokens from your browser.', }, { title: 'Extension Permissions', - body: 'The Chrome extension requests permissions only to access selected text, context menus, and text-to-speech features. No browsing history or personal communications are accessed.', + body: 'The extension (Chrome and Firefox) asks only for what its features need: storage (settings and login), text-to-speech (Chrome), active tab and scripting (reading the selection you save and adding the selection button), context menus (right-click actions), notifications (save and summary messages), and access to websites (the selection button on pages, and our server). You can limit website access in your browser at any time; the extension then asks before it runs on a site.', + }, + { + title: 'Changes', + body: 'If this policy changes, we will update it here and change the effective date above.', }, - { title: 'Contact', body: 'For privacy questions, contact: prateeksharma.2801@gmail.com' }, + { title: 'Contact', body: 'For privacy questions or to delete your account, contact: prateeksharma.2801@gmail.com' }, ] export default function PrivacyPolicyPage() { @@ -36,10 +66,19 @@ export default function PrivacyPolicyPage() { - {SECTIONS.map(({ title, body }) => ( -

- {title}: {body} -

+ {SECTIONS.map(({ title, body, items }) => ( +
+

+ {title}: {body} +

+ {items && ( +
    + {items.map((item) => ( +
  • {item}
  • + ))} +
+ )} +
))}