Skip to content
Snippets Groups Projects
icommonsCRC's avatar
icommonsCRC authored
651b656c
History
Name Last commit Last update
README.md
VCLScript.js

VM Warning Script

Description

This userscript displays a warning dialog to students when they access a virtual machine (VM) website. It reminds them that their data is not saved after the session and prompts them to use OneDrive for file storage. After acknowledging the warning, the script attempts to activate full-screen mode for the VM.

Features

  • Displays a warning dialog when the VM page loads
  • Reminds students to use OneDrive for file storage
  • Attempts to activate full-screen mode after the warning is acknowledged
  • Works with Tampermonkey browser extension

Installation

  1. Install the Tampermonkey browser extension for your preferred browser.

  2. Click on the Tampermonkey icon and select "Create a new script."

  3. Copy and paste the entire script into the editor.

  4. Replace https://your-vm-site-url.com/* in the @match line with the actual URL of your VM website.

  5. Save the script by pressing Ctrl+S or clicking File > Save.

Usage

Once installed, the script will automatically run when students visit the specified VM website. They will see a warning dialog reminding them to save their work to OneDrive. After clicking "OK," the script will attempt to activate full-screen mode.

Customization

You may need to customize the script based on your specific VM website:

  1. Warning Message: Modify the text inside the dialog.innerHTML if you need to change the warning message.

  2. Fullscreen Button: If the fullscreen button on your VM website has a different structure, update the selector in the clickFullscreenButton function.

Troubleshooting

If the script doesn't work as expected:

  1. Check the browser's console for debug messages (press F12 to open developer tools).
  2. Ensure the @match URL in the script matches your VM website URL.
  3. Verify that the fullscreen button selector in clickFullscreenButton function matches your website's HTML structure.

Maintenance

Periodically check and update the script, especially after any changes to the VM website's interface. The fullscreen button's HTML structure might change, requiring updates to the clickFullscreenButton function.