Canvas Tab Expander Userscript
What It Does
This userscript automatically expands all tabbed content in Canvas assignments, allowing you to view all assignment instructions on a single page instead of clicking through multiple tabs. It adds a convenient "Expand All Tabs" button at the top of the assignment description and automatically expands all content when the page loads.
How to Install
First, install a userscript manager:
Install the script:
- Click the Tampermonkey/Greasemonkey icon in your browser
- Select "Create new script"
- Copy and paste the provided script code
- Save the script (Ctrl+S or File → Save)
Features
- Automatically expands all tabs when you open an assignment
- Provides a button to manually re-expand tabs if needed
- Works with nested content and accordions
- Maintains all original formatting and content
- Only runs on Canvas assignment pages
- Handles dynamically loaded content
Customizing for Your School's Canvas URL
By default, the script works with URLs ending in "instructure.com", but many schools use custom Canvas URLs. Here's how to modify the script for your school:
- Find your school's Canvas URL pattern. Examples:
- canvas.university.edu
- lms.university.edu
- learn.university.edu
- Modify the
@match
line in the script:
- Find this line near the top of the script:
// @match https://*.instructure.com/courses/*/assignments/*
- Add your school's URL pattern. You can add multiple lines for multiple URLs:
// @match https://*.instructure.com/courses/*/assignments/*
// @match https://canvas.university.edu/courses/*/assignments/*
// @match https://lms.university.edu/courses/*/assignments/*
Example Modifications:
// @match https://*.instructure.com/courses/*/assignments/*
// @match https://canvas.university.edu/courses/*/assignments/*
// @match https://canvas.otherschool.edu/courses/*/assignments/*
Note: Make sure to keep the /courses/*/assignments/*
part of the URL pattern, as this ensures the script only runs on assignment pages.
Finding Your Canvas URL
- Go to your school's Canvas login page
- Look at the URL in your browser's address bar
- Copy everything between
https://
and the first /
after the domain
- Use this as your URL pattern in the script
Testing After Modification
After adding your school's URL:
- Save the script
- Refresh your Canvas assignment page
- Verify that the "Expand All Tabs" button appears
- Test that clicking the button expands all tabs
If the script doesn't work after modification, double-check that your URL pattern exactly matches your school's Canvas URL.
Safety and Privacy
- The script only runs on Canvas assignment pages
- Makes no external connections
- Doesn't collect or modify any user data
- Only modifies the display of content that's already visible to you
Acknowledgement
- This script was made with AI (Claude 3.5 Sonnet)