您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Auto close Slack's "We’ve redirected you to the desktop app." tabs.
// ==UserScript== // @name Auto Close Slack Tab on Redirect // @namespace https://*.slack.com/archives/* // @version 0.3 // @description Auto close Slack's "We’ve redirected you to the desktop app." tabs. // @author Tim Kersten // @match https://klarna.slack.com/archives/* // @grant none // @homepageURL https://gist.github.com/io41/304b1af0f83f82dd4408612b31bb25b5 // @license MIT // ==/UserScript== (function() { 'use strict'; // The text to search for const redirectText = "We’ve redirected you to the desktop app."; // Function to check for the redirect element function checkForRedirect() { const redirectElement = document.querySelector('p.p-ssb_redirect__loading_messages'); if (redirectElement && redirectElement.innerText.includes(redirectText)) { window.close(); } } // Check for the element 2 seconds after loading setTimeout(checkForRedirect, 2000); })();