GM
This commit is contained in:
20
content.js
Normal file
20
content.js
Normal 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");
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user