This commit is contained in:
2025-04-23 12:43:41 +04:00
commit 44d5b62b3c
9 changed files with 173 additions and 0 deletions

20
content.js Normal file
View File

@@ -0,0 +1,20 @@
document.addEventListener('DOMContentLoaded', function() {
const alternateLinks = document.querySelectorAll('link[rel="alternate"][type="application/nostr+json"]');
if (alternateLinks.length > 0) {
console.debug("[nostr-links] Found:", alternateLinks);
const links = Array.from(alternateLinks).map((link, index) => ({
uri: link.href.replace(/^(nostr|web+nostr):/, ""),
text: link.title.trim()
// icon: "icon.png"
}));
browser.runtime.sendMessage({
action: "showNostrLinksPageAction",
links: links
});
} else {
console.debug("[nostr-links] No nostr links found");
}
});