This repository contains the source code for the official Jumpsquare browser extension. It works in tandem with the main Jumpsquare project, bringing real-time jumpscare alerts directly to your favorite streaming services.
Never be caught off guard by a sudden scare again. The extension automatically detects the movie you're watching, fetches jumpscare data from Jumpsquare database, and displays timely on-screen warnings before each event.
- Real-Time Jumpscare Alerts: Displays on-screen toast notifications a few seconds before a jumpscare occurs.
- Automatic Movie Detection: Intelligently identifies the movie and year you are watching on supported platforms.
- Seamless Integration: Connects to the Heresthejump.com API to retrieve accurate, community-sourced jumpscare timestamps.
- Supported Services: Works on major streaming platforms.
- Informative Popup: The extension popup shows the detected movie, the number of jumpscares, and a link to the full details on the main website.
- Efficient & Modern: Built with TypeScript and Vite, using Manifest V3 for security and performance.
The extension is designed to be modular, allowing for easy addition of new streaming services.
- Netflix
- Amazon Prime Video
- Disney+
- Max (HBO)
- Hulu
- Language: TypeScript
- Bundler: Vite
- Styling: Tailwind CSS
- Extension Framework: Standard Web Extensions API (Manifest V3)
The codebase is organized into the main components of a browser extension:
/
├── dist/ # The built, unpacked extension ready for loading
├── public/ # Static assets like manifest.json and icons
├── src/
│ ├── background/ # Service worker: handles API calls, state management
│ │ ├── modules/ # Logic for API services, state, and message handling
│ │ └── background.ts # Main entry point for the service worker
│ ├── content/ # Injected into streaming sites: handles DOM interaction
│ │ ├── modules/ # Movie detection, video tracking, notification display
│ │ └── strategies/ # Platform-specific logic for detection and data extraction
│ ├── popup/ # UI code for the extension's popup window
│ │ ├── components/ # Reusable UI components for the popup
│ │ └── index.ts # Main entry point for the popup
│ ├── shared/ # Code shared across all parts of the extension
│ └── types/ # Global TypeScript types and interfaces
├── vite.config.ts # Vite build configuration for popup and background
└── vite.content.config.ts # Vite build configuration for the content script
- Service Detection: The
contentscript runs on supported streaming sites. AServiceRegistryuses a strategy pattern (PrimeVideoStrategy,NetflixStrategy, etc.) to identify the current platform. - Movie Identification: When you navigate to a movie page, the
MovieDetectoruses the active strategy to extract the movie's title and year from the DOM or network requests. - Data Fetching: The
contentscript sends the detected movie info to thebackgroundservice worker. TheMovieHandlerin the background calls the Jumpsquare API viaJumpscareApiServiceto fetch the jumpscare data. - State Management: The
TabStateManagerin the background script saves the movie and jumpscare data for the specific tab usingchrome.storage.session. This ensures the state persists during navigation within the tab. - Alert Scheduling: The background script sends the jumpscare data back to the
contentscript. TheNotificationOrchestratorreceives this data and passes it to theJumpscareScheduler. - Video Tracking: A
VideoTrackerattaches a listener to the page's<video>element. As the video plays, it reports thecurrentTimeto theNotificationOrchestrator. - Displaying Alerts: The
JumpscareSchedulerchecks thecurrentTimeagainst its pre-calculated warning windows. When a jumpscare is imminent, it triggers an event. TheNotificationPresenterthen uses aToastmodule to render a non-intrusive warning on the screen.
git clone https://github.com/feedforfools/jumpsquare-extension.git
cd jumpsquare-extensionnpm installThis command builds the extension in development mode and watches for changes.
npm run build:devThis will create a dist directory in the root of the project.
In Google Chrome or other Chromium-based browsers:
- Navigate to
chrome://extensions. - Enable "Developer mode" using the toggle in the top-right corner.
- Click on the "Load unpacked" button.
- Select the
distfolder from this project.
The extension is now installed and will automatically reload when you make changes to the source code (as long as the npm run build:dev command is running).