Thread:Project:Support desk/Force view source/reply (2)

Note that user subpages that end with .js or .css can't be edited by other users (except sysops) so you can create subpages like Special:Mypage/example.js and other users will be presented with a "protected" page where only the view source option is available.

This is obviously a hack, and may have side effects, like displaying the contents with syntax highlight if you have a specific extension for that