Created
June 5, 2025 02:04
-
-
Save ethinx/748227b8940e094622645db275545a8c to your computer and use it in GitHub Desktop.
make callsign clickable and redirect to qrz.com/db/{callsign}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name LOTW QSO Callsign Link | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.1 | |
| // @description Convert callsign to QRZ.com link | |
| // @match https://lotw.arrl.org/lotwuser/qsos* | |
| // @grant none | |
| // ==/UserScript== | |
| (function() { | |
| 'use strict'; | |
| // function to modify the table rows | |
| function modifyTableRows() { | |
| // Select all rows with class 'qso' | |
| const qsoRows = document.querySelectorAll('tr.qso'); | |
| qsoRows.forEach(row => { | |
| // Get the third td element (index 2) | |
| const callsignCell = row.getElementsByTagName('td')[2]; | |
| if (callsignCell) { | |
| // Get the current callsign text | |
| const callsign = callsignCell.textContent.trim(); | |
| // Create a new anchor element | |
| const link = document.createElement('a'); | |
| link.href = `https://qrz.com/db/${callsign}`; | |
| link.textContent = callsign; | |
| link.target = '_blank'; | |
| // Replace the text content with the new link | |
| callsignCell.innerHTML = ''; | |
| callsignCell.appendChild(link); | |
| } | |
| }); | |
| } | |
| // Run the modification when the page loads | |
| modifyTableRows(); | |
| // Optional: If the table is dynamically loaded, use a MutationObserver | |
| const observer = new MutationObserver(function(mutations) { | |
| mutations.forEach(function(mutation) { | |
| if (mutation.addedNodes.length) { | |
| modifyTableRows(); | |
| } | |
| }); | |
| }); | |
| // Start observing the table body | |
| const tableBody = document.querySelector('table tbody'); | |
| if (tableBody) { | |
| observer.observe(tableBody, { childList: true }); | |
| } | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment