- Open Chrome and navigate to:
chrome://extensions/ - Enable Developer mode (toggle in top-right)
- Click Load unpacked
- Select the
CourseMate-UHfolder - Done! You should see the extension in your toolbar
The extension will show warnings without icons. Add three PNG files to the icons/ folder:
icon16.png- 16×16 pixelsicon48.png- 48×48 pixelsicon128.png- 128×128 pixels
Quick option: Use any graduation cap or star icon from Flaticon or create simple text-based icons.
- Open
test.html(included in this folder) in Chrome - Important: The extension only runs on
*.uh.edudomains by default - To test locally, temporarily update
manifest.json:
"content_scripts": [
{
"matches": [
"https://*.uh.edu/*",
"file:///*" // ← Add this line for local testing
],- Reload the extension (
chrome://extensions/→ refresh icon) - Reload
test.html - You should see badges next to professor names!
- Navigate to any UH course catalog/schedule page
- Open browser console (F12)
- Look for logs:
[CourseMate] Content script loaded - If no badges appear, you need to configure selectors...
- Navigate to a UH course page with instructor names
- Right-click on an instructor name → Inspect
- Look at the HTML structure:
<!-- Example 1: Table cell with class -->
<td class="schedule-instructor">Smith, John</td>
<!-- Example 2: Span with data attribute -->
<span data-field="instructor">Johnson, Sarah</span>
<!-- Example 3: Div with specific class -->
<div class="faculty-name">Williams, Robert</div>- Identify the selector:
- If it has a class:
.schedule-instructorortd.schedule-instructor - If it has a data attribute:
[data-field="instructor"] - If it's in a specific column:
td:nth-child(4)(if instructors are always in 4th column)
- If it has a class:
- Open
contentScript.js - Find the
SELECTORSobject (around line 12) - Add your selectors:
const SELECTORS = {
instructorElements: [
'.instructor-name', // Keep existing ones
'.faculty-name',
'td.schedule-instructor', // ← ADD YOUR SELECTOR HERE
'[data-field="instructor"]', // ← OR HERE
],
// ...
};- Save the file
- Reload extension:
chrome://extensions/→ click ↻ on CourseMate - Reload the UH page
Open console on the UH page:
// Should show your selectors
window.courseMateDebug.showSelectors()
// Should detect professors
window.courseMateDebug.scan()Look for: [CourseMate] Found 8 elements matching "td.schedule-instructor"
Click the extension icon to open settings:
- Enable Extension: ON (toggle off to disable)
- Default School: University of Houston
- Cache Duration: 7 days (recommended)
- Debug Mode: ON for testing, OFF for normal use
- Save Settings: Apply changes
- Clear Cache: Removes all cached professor data (useful for testing)
1. Check if extension is running:
// In console on UH page
window.courseMateDebug // Should return an object2. Enable debug mode:
- Open extension settings
- Turn ON "Debug Mode"
- Reload page
- Check console for detailed logs
3. Test selectors:
// Show current selectors
window.courseMateDebug.showSelectors()
// Try adding a selector manually
window.courseMateDebug.addSelector('td.your-selector')
// Force re-scan
window.courseMateDebug.reset()4. Check the page URL:
- Extension only works on
*.uh.edudomains - Check
manifest.json→content_scripts.matches
The selectors might be too broad. Add exclusions:
// In contentScript.js
const SELECTORS = {
// ...
excludeElements: [
'nav',
'header',
'footer',
'.navigation',
'.sidebar', // ← Add elements to exclude
]
};- Open settings → Clear Cache
- Reload extension
- Reload UH page
The extension includes sample data for these professors (for testing):
- John Smith - 4.2/5 (47 ratings)
- Sarah Johnson - 4.8/5 (92 ratings)
- Robert Williams - 3.5/5 (23 ratings)
- Emily Davis - 4.6/5 (78 ratings)
Try these names in various formats:
- "Smith, John"
- "John Smith"
- "SMITH, JOHN"
- "Smith, John A."
All should work and normalize to the same professor.
To use real RateMyProfessors data:
- Open
background.js - Find the
TODO: Real RMP Providersection (around line 68) - Implement your data fetcher
- Change line 91 from:
to:
const DataProvider = MockProvider;
const DataProvider = RMPProvider; // Your implementation
Important: Respect RMP's terms of service and implement rate limiting!
After installation:
- Extension shows in
chrome://extensions/ - No errors in extension card
- Can open settings page
- Test page (
test.html) shows badges for mock professors - Console debug helpers work:
window.courseMateDebug - Real UH page detects instructors (after configuring selectors)
- Clicking badges opens new tab (to RMP)
- Settings persist after reload
// All debug helpers
window.courseMateDebug
// Test name extraction
window.courseMateDebug.testName('Smith, John')
// Show configuration
window.courseMateDebug.showSelectors()
// Force re-scan
window.courseMateDebug.scan()
// Reset and re-scan
window.courseMateDebug.reset()| Problem | Solution |
|---|---|
| No badges appear | Check selectors, enable debug mode, verify UH domain |
| Wrong professors detected | Refine selectors, add exclusions |
| Badges in wrong place | Adjust CSS in ui.css |
| Extension not loading | Check for errors in chrome://extensions/ |
| Mock data not showing | Names must exactly match mock data (case-insensitive) |
- Test locally with
test.html - Find UH selectors using Inspector
- Update
contentScript.jswith correct selectors - Verify on real UH pages
- Add real icons to
icons/folder - (Optional) Implement real RMP data provider
- Extension works entirely client-side (no backend required)
- All data cached locally in browser
- Rate limiting prevents excessive requests
- MutationObserver handles dynamic content
- Works with any number of instructors per page
Happy coding!