您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Automates environment selection, discards changes, and approves for specific environments.
This script also requires
The Auto-Environment-Clicker Tampermonkey script automates a multi-step workflow for selecting, discarding changes, and approving specific environment configurations on a website hosted on CloudFront. This script is designed to save time and reduce manual actions by detecting specific elements in the user interface based on an environment parameter provided in the URL (e.g., environment=test).
1. Detects the Environment Parameter: The script reads the environment value (test, dev, or prod) from the URL’s search parameters. If this parameter isn’t found, the script stops, as it relies on knowing which environment the user intends to interact with.
2. Selects the Environment: The script continuously checks for a <span> element with the class title that matches the specified environment (e.g., test). Once it finds a matching span, it clicks it to select the desired environment and stops further checks.
3. Handles Discard Changes Dialog: After selecting the environment, the script checks for a discard confirmation dialog and automatically clicks the “Yes” button to discard any changes that might be blocking the next action. This allows the process to continue smoothly without interruption.
4. Approves the Selected Environment: The final step waits for an “Approve” button to appear. Once detected, the script clicks the button to confirm the environment selection and finalize the process. After clicking, the script stops executing.
In a CI/CD or staging environment, teams often need to switch between different environments (like test, dev, or prod) to deploy, configure, or validate changes. Manually navigating through these steps can be repetitive and error-prone, especially if the process includes confirmation dialogs and multi-step actions that must be performed consistently.
The Auto-Environment-Clicker script streamlines this workflow by automating each step, reducing manual input, and ensuring that the correct actions are performed in sequence. By handling environment selection, discarding unsaved changes, and clicking “Approve” automatically, this script helps:
• Save Time: Automates repetitive UI actions.
• Minimize Human Error: Reduces the risk of selecting the wrong environment or missing confirmation steps.
• Increase Productivity: Frees up team members to focus on more complex tasks.
This tool is especially helpful for developers, testers, or DevOps engineers who work across multiple environments and frequently need to verify deployments or configurations.