What is a User Script?

Useful tasks like improving layout, fixing bugs, automating common tasks and adding new functions can all be done by userscripts. More complicated userscripts can create mash-ups by combining information from different websites or embedding new data into a web page, e.g. to add reviews or price comparisons to a shopping website.

A user script is programming that modifies the appearance or behavior of an application. A user script for a Web site, for example, can customize the way that content will display in the host browser.

I'm planning out a curriculum for my web development class next year, and based on a comment by Sean Houlihane I realized that userscripts could be useful as a teaching tool so that students can see results immediately, and actually make use of their front-end skills as soon as they know the basics.

Before I would introduce my students to this, they'd have to understand the basics of HTML/CSS/JS. If my students already have basic knowledge, how useful could userscripts be as a teaching tool and what are some ways in which I could use them?

Some potential issues that I foresee are:

• It'll be complicated. For a major website, the stylesheet could be thousand LoC.
• Minification. Especially for JS. It makes it very challenging to modify existing code if it has been minified. Even when re-prettified, it can still have terrible variable and method naming.

Working around these issues, what are some uses for userscripts as a teaching tool and in the classroom?

Consider Bloom's taxonomy here. You have an opportunity to move up the ladder as follows: Comprehension/Knowledge (basic HTML/CSS) --> Application/Analysis (Developer Tools/Inspect) --> Synthesis/Creation (Userscripts). This progression is important to keep in mind so as to adequately prepare students for creating something meaningful of their own, and I think the study of how popular sites are structured will aid in this process. Hacking away for fun at a page may give them an idea for what would be cool to script themselves.