Skip to content

Commit

Permalink
fix: medium battery
Browse files Browse the repository at this point in the history
  • Loading branch information
pavanjoshi914 authored and im-adithya committed Dec 11, 2024
1 parent a75430c commit 7943537
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/extension/content-script/batteries/Medium.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ const urlMatcher = /^https:\/\/(.+\.)?medium.com\/(\S+)?/;
const battery = (): void => {
const name =
document.querySelector<HTMLHeadingElement>(".pw-author-name")?.innerText;
const description = document.querySelector<HTMLParagraphElement>(
".pw-follower-count ~ p"
)?.textContent;

const description = document
.querySelector(".pw-author-name")
?.parentElement?.parentElement?.querySelector("p")
?.querySelector("span")?.textContent;

if (!name || !description) return;

const match = findLightningAddressInText(description);
Expand Down

0 comments on commit 7943537

Please sign in to comment.