Reputation: 61
I am trying to develop a firefox add-on which would allow me to highlight a text on the web page (any webpage client side) and then allwo me to write a note and save it. So when i visit the web page next time, if an annotation exists for a webpage it shows up a small Anchor/link next to the text, which on clciking should display the annotation that i typed in earlier.
Is this possible? Any ideas on how to go about it?
cheers
Upvotes: 1
Views: 633
Reputation: 1538
This sounds eerily similar to an idea I posted on Hacker News a few days ago. Interesting! Anyway, it sounds like you want to know what text is selected when you go to create your annotation. Googling "javascript text selection" lead me here, hope this helps!
http://javascript.internet.com/page-details/highlighted-text.html
Cheers! :)
Upvotes: 1
Reputation: 57177
Definitely possible.
For example, you could use sqlite from an extension and, in that, store urls (or their hash) and any associated annotations. Then when visiting a page, check against the DB, and restore the annotations.
As to how you specifically want to accomplish this is up to you. There is no shortage of ways to accomplish this.
See Building an Extension and Storage at MDC.
Upvotes: 0