A Chrome extension that enables users to save web pages directly to their Learntime MemoryStack for active recall practice.
The extension operates through three main components:
-
Popup Interface (
popup.html,popup.js)- Handles user authentication with Learntime
- Fetches and displays user's MemoryStacks
- Provides interface for saving the current page
-
Content Script (
content.js)- Extracts main content from web pages
- Filters out unnecessary elements (ads, scripts, navigation)
- Cleans and processes text content for optimal learning
-
Background Integration
- Manages communication between popup and content script
- Handles API interactions with Learntime backend
The extension interacts with the Learntime API in the following ways:
GET / api / auth / session;
// Returns current session information and access tokenGET / api / workspaces;
// Requires: Bearer token
// Returns: List of user's MemoryStacksPOST / api / create - topic - from - web;
// Requires: Bearer token
// Payload: {
// title: string, // Page title
// content: string, // Extracted content
// url: string, // Source URL
// workspaceId: string // Selected MemoryStack ID
// }
// Returns: {
// success: boolean,
// chatId?: string, // ID of created topic
// error?: string
// }The content script employs the following strategy to extract relevant content:
- Removes unwanted elements (scripts, styles, ads)
- Attempts to locate main content in
<article>or<main>tags - Falls back to body content if specific containers aren't found
- Cleans and normalizes text content
- Limits content length to prevent oversized topics
- Uses activeTab permission to access content only when explicitly triggered
- Connects only to app.learntime.ai domain
- No local storage of user data
- Requires explicit user action to capture content
- Clone the repository
- Install dependencies:
npm install - Build the extension:
npm run build - Load unpacked extension in Chrome from the
distdirectory
The extension requires the following environment configurations:
- Production API URL set to
https://app.learntime.ai - Appropriate host permissions in manifest.json
- Proper Chrome Web Store assets and listings