6.1 Course Resources

Script Managers

To manage and run userscripts we recommend using either the Firefox or Chrome browsers and using these browser extensions 

Example

As an example, we briefly illustrate a relatively simple userscript that determines the type and count of all the files in a Canvas site. While this functionality may have limited practical use, we use it to show process of installing a script manager (Tampermonkey) in a browser (Chrome), installing a script (Canvas-Files-Get_Files.user.js), and running it in a Canvas course. The script is programmed only to run on the "Files" page of a Canvas site and generates a button on the page to activate the data collection. Once the button is pressed, the script uses the Canvas Files API (application programming interface) to ask for a list of all the files uploaded to the current Canvas site.  The site counts them by file type and pops up a panel displaying the results.

The userscript, Canvas-Files-Get_Files.user.js, can be downloaded from this link. 

Canvas-Files-Get_Files.user.js Links to an external site.

Here are links to two screencasts that show the steps needed to install Tampermonkey in Chrome, install the Canvas-Files-Get_Files.user.js userscript, and run it on the Canvas Files page. In the second module, we have instructions for installing Greasemonkey with Firefox.

Part 1: Installing Tampermonkey and Running a Userscript Links to an external site.

Part 2: Using the Chrome Developer Console to View Userscript Output Links to an external site.