42 lines
1.4 KiB
JavaScript
42 lines
1.4 KiB
JavaScript
// ==UserScript==
|
|
// @name Auto Click Audit Tab
|
|
// @namespace http://tampermonkey.net/
|
|
// @version 1.0
|
|
// @description Automatically click the "审核建档" tab on the specified page
|
|
// @author You
|
|
// @match https://intraecrm.yw.zj.chinamobile.com/page/newGroupAddCustomer
|
|
// @grant none
|
|
// ==/UserScript==
|
|
|
|
(function() {
|
|
'use strict';
|
|
|
|
// Function to check for the tab and click it
|
|
function checkAndClickTab() {
|
|
// Look for the specific tab element
|
|
const auditTab = document.querySelector('a.tabs-inner span.tabs-title');
|
|
|
|
// If the tab exists and has the correct text
|
|
if (auditTab && auditTab.textContent.trim() === '审核建档') {
|
|
// Click the parent <a> element
|
|
auditTab.closest('a.tabs-inner').click();
|
|
console.log('Successfully clicked the "审核建档" tab');
|
|
}
|
|
}
|
|
|
|
// Wait for the page to load completely
|
|
window.addEventListener('load', function() {
|
|
// Also use a small delay to ensure elements are rendered
|
|
setTimeout(checkAndClickTab, 1000);
|
|
});
|
|
|
|
// In case the page content loads dynamically, check periodically
|
|
const interval = setInterval(function() {
|
|
checkAndClickTab();
|
|
}, 2000);
|
|
|
|
// Stop checking after 30 seconds to avoid infinite loops
|
|
setTimeout(function() {
|
|
clearInterval(interval);
|
|
}, 30000);
|
|
})(); |