Skip to content

Commit

Permalink
dont anchor to my own button
Browse files Browse the repository at this point in the history
  • Loading branch information
usyless committed Sep 18, 2024
1 parent 3616663 commit bbe1308
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion twitter_improvements.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
}

static anchor(article) {
const anchor = article.querySelector('button[aria-label="Share post"]').parentElement.parentElement;
const anchor = article.querySelector('button[aria-label="Share post"]:not([usy])').parentElement.parentElement;
if (!fallbackButton) fallbackButton = anchor;
return anchor;
}
Expand Down Expand Up @@ -101,6 +101,7 @@
shareButton = shareButton.cloneNode(true);
shareButton.classList.add('usybuttonclickdiv');
if (attribute != null) shareButton.setAttribute(attribute, "");
shareButton.querySelector('button[aria-label="Share post"]').setAttribute('usy', '');
shareButton.querySelector('path').setAttribute("d", path);
const bc = shareButton.querySelector('button').firstElementChild;
shareButton.addEventListener('mouseover', () => Button.onhover(bc));
Expand Down

0 comments on commit bbe1308

Please sign in to comment.