debug: add detailed logging for bookmark content

- Check if bookmark list has encrypted content
- Log content preview to understand the structure
- This will help determine why browser extension isn't triggered
This commit is contained in:
Gigi
2025-10-02 10:15:34 +02:00
parent 610de95481
commit c5a32b911d

View File

@@ -114,11 +114,23 @@ export const fetchBookmarks = async (
const bookmarkListEvent = bookmarkListEvents[0]
console.log('Found bookmark list event:', bookmarkListEvent.id)
console.log('Bookmark list content:', bookmarkListEvent.content)
console.log('Bookmark list tags:', bookmarkListEvent.tags)
// Use applesauce helpers to get public bookmarks
const publicBookmarks = Helpers.getPublicBookmarks(bookmarkListEvent)
console.log('Public bookmarks:', publicBookmarks)
// Check if there's encrypted content that needs decryption
const hasEncryptedContent = bookmarkListEvent.content &&
(bookmarkListEvent.content.includes('?iv=') ||
bookmarkListEvent.content.includes('?version=') ||
bookmarkListEvent.content.startsWith('nip44:') ||
bookmarkListEvent.content.startsWith('nip04:'))
console.log('Has encrypted content:', hasEncryptedContent)
console.log('Content preview:', bookmarkListEvent.content?.substring(0, 100))
// Try to get private bookmarks - this should trigger browser extension if needed
let privateBookmarks = null
try {