您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Auto closes the AWS VPN connection message
// ==UserScript== // @name Auto close VPN connection message // @namespace urn://https://www.georgegillams.co.uk/api/greasemonkey/auto-close-vpn-connection-message // @include *127.0.0.1* // @exclude none // @version 1.0.1 // @description:en Auto closes the AWS VPN connection message // @grant none // @description Auto closes the AWS VPN connection message // @license MIT // ==/UserScript== function closeTab(targetElement) { const newElement = document.createElement('a'); newElement.href = "javascript:window.open('','_self').close();"; newElement.innerText = 'Close'; targetElement.appendChild(newElement); newElement.click(); } function checkAndCloseTab() { const bodyElement = document.getElementsByTagName('BODY')[0]; if (bodyElement.innerText.includes('You may close this window at any time')) { closeTab(bodyElement); } } function worker() { try { checkAndCloseTab(); } catch (e) { // eslint-disable-next-line no-console console.log(e); } } setInterval(worker, 500);