A Chrome Extension (Manifest V3) that notifies you when a new question appears in an active MathMatize poll session on mathmatize.com. It uses your existing logged-in session and does not send any data off your device.
- Desktop notification when the current question changes: title “New MathMatize Question”, body “A new question was posted in your poll session.”
- Optional sound (short beep) with each notification.
- Multiple detection strategies: DOM selectors, network (fetch/XHR) responses, and MutationObserver, with fallbacks.
- Options: toggle notifications/sound, “only when MathMatize tab is not active”, and poll interval (1–10 s).
- Open Chrome and go to
chrome://extensions/. - Turn Developer mode on (top-right toggle).
- Click Load unpacked.
- Choose the folder that contains this project (the one with
manifest.json). - The extension should appear in your list. Keep the page open on a MathMatize poll/session URL to receive notifications when a new question is pushed.
| File | Purpose |
|---|---|
manifest.json |
Extension manifest (MV3), permissions, content script matches. |
background.js |
Service worker: creates notifications, optional sound, handles messages. |
content.js |
Runs on MathMatize poll/session pages: fingerprinting, network patch, MutationObserver. |
options.html / options.js |
Options UI: notifications on/off, sound on/off, “only when inactive”, poll interval. |
icons/ |
Extension icons (16, 48, 128). Replace with your own if you like. |
The extension detects the “current question” using several strategies. If the site’s HTML or structure changes, you can adjust behavior by editing content.js.
Open content.js and find the SELECTORS object near the top (and the API_QUESTION_KEYS array just below it). All selector and API-key customization is there.
-
QUESTION_SELECTORS
Elements that hold the question title or text (e.g. headings,.question-title). The script uses the first matching element with non-empty text.- Add or reorder selectors to match the new DOM (e.g. new class names or
data-*attributes).
- Add or reorder selectors to match the new DOM (e.g. new class names or
-
QUESTION_ID_SELECTORS
Elements that have a question id in a data attribute (data-question-id,data-id, etc.).- If MathMatize adds new attributes (e.g.
data-poll-id), add a selector and read that attribute in the block that buildsparts.id.
- If MathMatize adds new attributes (e.g.
-
QUESTION_NUMBER_SELECTORS
Elements that show “Question 1”, “Q2”, etc.- Update or add selectors if the question number moves to a new element or class.
-
MAIN_CONTENT_SELECTORS
The main content container used for:- MutationObserver (where we listen for DOM changes), and
- Fallback when no question-specific element is found (we take a short text snippet from here).
- If the main area gets a new wrapper (e.g.
#poll-root), add it at the beginning of this array so it’s tried first.
-
API_QUESTION_KEYS
Keys we look for in JSON API responses (from our fetch/XHR patch) to build a fingerprint (e.g.questionId,question_text,title).- If MathMatize’s API starts using different field names, add them here (and keep existing ones as fallbacks).
- Choose the right array (question text, id, number, or main content).
- Add a string like
'.new-class-name'or'[data-new-attr]'at the position you want (earlier = higher priority). - For question id, if you use a new attribute, add it both to
QUESTION_ID_SELECTORSand in the block that doesel.getAttribute('...')when buildingparts.id.
Content script runs only on URLs matched in manifest.json under content_scripts[].matches. If MathMatize adds new paths for polls (e.g. /v2/session/...), add a matching pattern there, for example:
"https://www.mathmatize.com/v2/session/*"Reload the extension after any change.
To see detailed logs in the browser console:
- Content script (page context): open
content.js, setDEBUG = trueat the top, save, and reload the extension. Then open a MathMatize poll page, open DevTools → Console, and look for messages starting with[MathMatize Notifier]. - Background: open
background.js, setDEBUG = trueat the top, save, and reload the extension. Then openchrome://extensions/, find the extension, and click “Service worker” to open its console. Logs will appear there.
Remember to set DEBUG = false when you’re done troubleshooting.
- The extension only runs on mathmatize.com (and www).
- It does not send data to any external server.
- It uses chrome.storage.local for your preferences and the last question fingerprint per tab/session.
- It does not scrape private content beyond what’s needed to detect a new question (e.g. a short snippet or id for fingerprinting).
- storage: save options and last fingerprint.
- notifications: show desktop notifications.
- activeTab / tabs: used so “only notify when MathMatize tab is not active” can check the active tab.
- host_permissions for
https://www.mathmatize.com/*andhttps://mathmatize.com/*: needed for the content script to run on those pages.
The icons/ folder contains simple placeholder PNGs. To use your own:
- Provide icon16.png, icon48.png, and icon128.png in the
icons/directory (or update paths inmanifest.json). - Reload the extension.