您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Automatically clicks the "Allow Access" button when it becomes available.
// ==UserScript== // @name AWS CLI - Auto Click "Allow Access" // @namespace http://tampermonkey.net/ // @version 2025-03-04 // @description Automatically clicks the "Allow Access" button when it becomes available. // @author You // @match https://d-9a67274801.awsapps.com/start/ // @icon https://www.google.com/s2/favicons?sz=64&domain=awsapps.com // @grant none // @run-at document-idle // @license MIT // ==/UserScript== (function() { 'use strict'; // Function to check and click the button function clickAllowAccessButton() { const button = document.querySelector('[data-testid="allow-access-button"]'); if (button) { console.log("Allow Access button found, clicking now..."); button.click(); // Close the tab after 2 seconds setTimeout(() => { window.close() }, 2000); } } // Use a MutationObserver to detect changes in the DOM const observer = new MutationObserver(() => { clickAllowAccessButton(); }); // Start observing the document body for changes observer.observe(document.body, { childList: true, subtree: true }); // Run the function initially in case the button is already present clickAllowAccessButton(); })();