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
-
Install the Tampermonkey browser extension for your preferred browser.
-
Click on the Tampermonkey icon and select "Create a new script."
-
Copy and paste the entire script into the editor.
-
Replace
https://your-vm-site-url.com/*
in the@match
line with the actual URL of your VM website. -
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:
-
Warning Message: Modify the text inside the
dialog.innerHTML
if you need to change the warning message. -
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:
- Check the browser's console for debug messages (press F12 to open developer tools).
- Ensure the
@match
URL in the script matches your VM website URL. - 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.