Removed logging and only run on issue view

This commit is contained in:
2026-02-19 21:59:44 -05:00
parent 4ebcace14c
commit d1345cc2b8

View File

@@ -1,13 +1,11 @@
$(function() { $(function() {
const regex = /^\/issues\/\d+/;
if (regex.test(window.location.pathname)) {
const firstElement = document.getElementsByClassName('int_cf cf_4 attribute')[0].children[1]; const firstElement = document.getElementsByClassName('int_cf cf_4 attribute')[0].children[1];
console.log(firstElement);
if (firstElement) { // Check if the element exists if (firstElement) { // Check if the element exists
firstElement.addEventListener('click', function() { firstElement.addEventListener('click', function() {
console.log('The first element was clicked!');
try { try {
const text = firstElement.innerText; const text = firstElement.innerText;
console.log(text);
navigator.clipboard.writeText(text); navigator.clipboard.writeText(text);
firstElement.innerHTML = "<b>Copied!</b>"; firstElement.innerHTML = "<b>Copied!</b>";
@@ -22,5 +20,6 @@ $(function() {
console.error('Unable to copy', err); console.error('Unable to copy', err);
} }
}); });
}
} }
}); });