
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
html-annotator
Advanced tools
HTML-Annotator is derived from Annotator which ended development in 2015. HTML-Annotator is a JavaScript library for annotating HTML pages. It provides a set of tools for annotating content in webpages.
Components within Annotator provide:
npm install html-annotator
import annotator from "html-annotator";
const elem = document.getElementById("content");
const app = new annotator.App()
.include(annotator.ui.main, {element: elem})
app.start()
This will enable annotations but the annotations won't be persisted.
Additional functionality is provided through plugins. Plugins are added using the app.include() method.
Local storage is supported through the inbuilt plugin localStore.
import annotator from "html-annotator";
const elem = document.getElementById("content");
const app = new annotator.App()
.include(annotator.ui.main, {element: elem})
.include(annotator.storage.localStore);
app.start().then(() => {
app.annotations.load({
uri: window.location.href //load saved annotations
});
});
import annotator from "html-annotator";
const elem = document.getElementById("content");
const app = new annotator.App()
.include(annotator.ui.main, {
element: elem,
editorExtensions: [annotator.ui.colorPicker.editorExtension]
})
.include(annotator.storage.localStore);
app.start().then(() => {
app.annotations.load({
uri: window.location.href
});
});
A plugin is a JS Object that implements certain callback methods.
Here is a simple plugin that prints debug info when the app starts and gets destroyed
function helloWord(){
return {
start(app){
console.debug('app started');
},
destroy(){
console.debug('app destroyed');
}
}
}
This is a list of module hooks, when they are called, and what arguments they receive.
annotationsLoaded(annotations)
Called when annotations are retrieved from storage using load().beforeAnnotationCreated(annotation)
Called immediately before an annotation is created. Modules may use this hook to modify the annotation before it is saved.annotationCreated(annotation)
Called when a new annotation is created.beforeAnnotationUpdated(annotation)
Called immediately before an annotation is updated. Modules may use this hook to modify the annotation before it is saved.annotationUpdated(annotation)
Called when an annotation is updated.beforeAnnotationDeleted(annotation)
Called immediately before an annotation is deleted. Use if you need to conditionally cancel deletion, for example.annotationDeleted(annotation)
Called when an annotation is deleted.
npm install
npm run serve
Please report bugs using the GitHub issue tracker. Please be sure to use the
search facility to see if anyone else has reported the same bug -- don't submit
duplicates.
Please endeavour to follow good practice for reporting bugs when you submit
an issue.
MIT
FAQs
Annotation for the html content.
We found that html-annotator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.