diff --git a/shared-ip-manager.userscript.js b/shared-ip-manager.userscript.js index 2ebd510..cc94885 100644 --- a/shared-ip-manager.userscript.js +++ b/shared-ip-manager.userscript.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Shared IP Manager // @namespace http://tampermonkey.net/ -// @version 1.1.1 +// @version 1.1.2 // @description Transform shared IP overlay into searchable table format // @author Ryahn // @match *://*/* @@ -59,7 +59,7 @@ // Find all user entries const userEntries = overlay.querySelectorAll('.block-row.block-row--separated'); - + if (userEntries.length === 0) return; // Create table container @@ -112,7 +112,7 @@ transition: all 0.2s; white-space: nowrap; `; - + // Add hover effect for button bannedFilterButton.addEventListener('mouseenter', function() { this.style.backgroundColor = '#dc2626'; @@ -166,48 +166,48 @@ // Create table header const thead = document.createElement('thead'); thead.style.cssText = `position: sticky; top: 0; z-index: 10;`; - + const headerRow = document.createElement('tr'); headerRow.style.cssText = `background: #101113; border-bottom: 1px solid #101113; color: #959595;`; - + // Username header (sortable) const usernameHeader = document.createElement('th'); usernameHeader.id = 'sort-username'; usernameHeader.style.cssText = `padding: 10px 12px; text-align: left; border-right: 1px solid #17191b; font-weight: 600; color: #959595; white-space: nowrap; cursor: pointer; user-select: none;`; usernameHeader.innerHTML = `Username ↕`; - + // Join Date header const joinDateHeader = document.createElement('th'); joinDateHeader.style.cssText = `padding: 10px 12px; text-align: left; border-right: 1px solid #17191b; font-weight: 600; color: #959595; white-space: nowrap;`; joinDateHeader.textContent = 'Join Date'; - + // Messages header const messagesHeader = document.createElement('th'); messagesHeader.style.cssText = `padding: 10px 12px; text-align: left; border-right: 1px solid #17191b; font-weight: 600; color: #959595; white-space: nowrap;`; messagesHeader.textContent = 'Messages'; - + // Country header const countryHeader = document.createElement('th'); countryHeader.style.cssText = `padding: 10px 12px; text-align: left; border-right: 1px solid #17191b; font-weight: 600; color: #959595; white-space: nowrap;`; countryHeader.textContent = 'Country'; - + // Provider header const providerHeader = document.createElement('th'); providerHeader.style.cssText = `padding: 10px 12px; text-align: left; border-right: 1px solid #17191b; font-weight: 600; color: #959595; white-space: nowrap;`; providerHeader.textContent = 'Provider'; - + // Type header (sortable) const typeHeader = document.createElement('th'); typeHeader.id = 'sort-type'; typeHeader.style.cssText = `padding: 10px 12px; text-align: left; border-right: 1px solid #17191b; font-weight: 600; color: #959595; white-space: nowrap; cursor: pointer; user-select: none;`; typeHeader.innerHTML = `Type ↕`; - + // Usage header (sortable) const usageHeader = document.createElement('th'); usageHeader.id = 'sort-usage'; usageHeader.style.cssText = `padding: 10px 12px; text-align: left; font-weight: 600; color: #959595; white-space: nowrap; cursor: pointer; user-select: none;`; usageHeader.innerHTML = `Usage ↕`; - + // Append all headers to row headerRow.appendChild(usernameHeader); headerRow.appendChild(joinDateHeader); @@ -216,12 +216,12 @@ headerRow.appendChild(providerHeader); headerRow.appendChild(typeHeader); headerRow.appendChild(usageHeader); - + thead.appendChild(headerRow); // Create table body const tbody = document.createElement('tbody'); - + // Process each user entry userEntries.forEach((entry, index) => { const row = document.createElement('tr'); @@ -235,15 +235,15 @@ const usernameLink = entry.querySelector('h3.contentRow-header a.username'); const username = usernameLink ? usernameLink.textContent.trim() : 'N/A'; const profileUrl = usernameLink ? usernameLink.href : '#'; - + // Check if user is banned const usernameSpan = entry.querySelector('h3.contentRow-header a.username span'); const isBanned = usernameSpan && usernameSpan.classList.contains('username--banned'); - + // Join date const joinDateElement = entry.querySelector('time.u-dt'); const joinDate = joinDateElement ? joinDateElement.textContent.trim() : 'N/A'; - + // Messages const dtElements = entry.querySelectorAll('dt'); let messagesElement = null; @@ -253,23 +253,23 @@ break; } } - const messages = messagesElement ? + const messages = messagesElement ? (messagesElement.nextElementSibling ? messagesElement.nextElementSibling.textContent.trim() : '0') : '0'; - + // Country flag and name const flagElement = entry.querySelector('.tck-provider-country-flag'); const countryCode = flagElement ? getCountryCode(flagElement) : ''; const countryName = flagElement ? getCountryName(flagElement) : ''; const flagEmoji = getFlagEmoji(countryCode); - + // Provider info const providerElement = entry.querySelector('.tck-provider-txt'); const providerInfo = providerElement ? getProviderInfo(providerElement) : { name: 'N/A', asn: '' }; - + // Type info const typeElement = entry.querySelector('.tck-provider-type'); const typeInfo = typeElement ? getTypeInfo(typeElement) : 'N/A'; - + // Usage count const liElements = entry.querySelectorAll('li'); let usageElement = null; @@ -281,8 +281,8 @@ } const usageText = usageElement ? usageElement.textContent.trim() : '0 time'; const usageCount = getUsageCount(usageText); - - + + // Build row HTML row.innerHTML = `